Incorrect and confusing error message when writing node custom modules

Wappler Version : 7.5.2
Operating System : win 100
Server Model: node
Database Type:
Hosting Type:

Expected behavior

A relevant error message should be displayed indicating the real cause

Actual behavior

The misleading message
{"status":"500","message":"Module xxxxxx doesn't exist" ...

How to reproduce

While this message infers that the module in in fact missing i.e. incorrectly referenced in the HJSON, a common source is actually that a module dependency is either missing or wrongly referenced rather than the module itself

For example:
const path = require('path') would generate that error if "path" was missing or the wrong version or if wrongly referenced such as const path = require('./path');

Can a more relevant/ helpful message be reported as this is causing confusion with many extension developers. This is compounded by the fact that AI has no knowledge of this "quirk" so tends to take users down a rabbit hole of no return with increasing promises of things being a "bullet proof" solution which will never work.

Bump, this is still an issue with 7.7.1. We’re having problems correctly debugging an extension, getting an accurate error response would make life so much easier.

Please test if this update solves the issue:

app.zip (6.5 KB) Unzip to lib/core.

1 Like

Sorry @patrick but where does that go, i dont seem to have a file called app.js in my project.

Is that a replacement for index.js, it seems a lot bigger!

You should have a lib folder in your project root, the app.js is located in lib/core.

Thanks @patrick, that seems to have done the trick, proper error messages now

1 Like

Fixed in Wappler 7.7.2

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.