Auth0 post login action cannot find module 'auth0' node16

When trying to use var ManagementClient = require('auth0@3.0.1').ManagementClient; or any version I found in Can I require? - Search which node modules you can use in webtask.io
I get error:

{
"code": 400,
"message": "Compilation failed: Cannot find module 'auth0@3.0.1'\nRequire stack:\n- /data/io/node16/..../webtask.js",
"error": "Cannot find module 'auth0@3.0.1'\nRequire stack:\n- /data/io/node16/..../webtask.js",
....
}

What could be the cause?

Hey there @eemil.ilkka!

The only way I was able to reproduce this was by having a mismatched dependency defined in the Action vs. require - For example:

Are you able to confirm that this is not the case in your environment?

2 Likes

The dependency is the same as in the code. I’ve also tried with not adding the auth0 to the dependency. It works in post user registration just fine.

but in login flow not

{
"code": 400,
"message": "Compilation failed: Cannot find module 'auth0@3.0.1'\nRequire stack:\n- /data/io/node16/08df48a1-cfaf-47a3-9a9e-e03a0b1edc15/webtask.js",
"error": "Cannot find module 'auth0@3.0.1'\nRequire stack:\n- /data/io/node16/08df48a1-cfaf-47a3-9a9e-e03a0b1edc15/webtask.js",
"stack": "Error: Cannot find module 'auth0@3.0.1'\nRequire stack:\n- /data/io/node16/08df48a1-cfaf-47a3-9a9e-e03a0b1edc15/webtask.js\n at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)\n at Function.WebtaskModule._resolveFilename (/data/sandbox/lib/module.js:117:17)\n at WebtaskModule.require (/data/sandbox/lib/module.js:196:37)\n at require (/data/sandbox/lib/module.js:237:17)\n at module.exports (/data/io/node16/08df48a1-cfaf-47a3-9a9e-e03a0b1edc15/webtask.js:2:24)\n at /data/io/8386cedabc1a62d90b8687bcdcfeb725862055d8.js:5:162\n at Object.defaultJavascriptCompiler [as nodejsCompiler] (/data/sandbox/lib/compiler.js:137:14)\n at /data/io/8386cedabc1a62d90b8687bcdcfeb725862055d8.js:5:14\n at /data/sandbox/lib/compiler.js:294:11\n at /data/sandbox/node16/node_modules/async/dist/async.js:3883:24"
}

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