-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting TypeError upon initilizing ManagementClient #815
Comments
Hi @neeraj87 - thanks for raising this It's hard to tell from the stacktrace you've shared and I'm not familiar with how lambda supports ESM. You could try commonjs ( If you can provide a repo that demonstrates the issue I could debug it for you. |
the problem is webpack finds the module .mjs file and tries to load that. this is the actual error: this seems to be the fix: |
@mribichich so the solution is to add when I do this >
|
@adamjmcgrath I tried using both |
@neeraj87 is your project in ESM? eg in |
I wasn't able to fix it, so went out to use axios with the api definitions... |
👋 Have got a branch that should fix this here https://github.com/auth0/node-auth0/tree/fix-esm Have tested it on serverless-bundle's Serverless Node.js Starter You can see the modifications I had to do to get the serverless-bundle application to work with
Could someone test out the branch and let me know if ti works for them? Then I'll go ahead and ship a patch |
Hey, is there a way I can npm install it? or do I just have to clone and link the branch? |
Hi @PSoltes Yes, either:
|
Tested with externals: {
...(config.externals || {}),
formidable: "formidable",
},
resolve: {
...
alias: {
"superagent-proxy": false,
},
},
output: {
path: path.join(__dirname, ".webpack"),
library: {
type: "module",
},
},
experiments: {
outputModule: true,
}, |
Thanks @PSoltes - I'll raise a PR |
@adamjmcgrath so do I just reinstall auth0 and will it start working? |
@adamjmcgrath I updated auth0 and @types/auth0 package on my project but I still keep getting this error
|
I am trying to initialize Auth0 ManagementClient in my Lambda function (Node.js + Typescript)
and it gives me the following error
I am using the following versions for auth0
auth0: 3.3.0
and@types/auth0: 2.35.9
I am not sure what I am doing wrong here.
The text was updated successfully, but these errors were encountered: