-
Notifications
You must be signed in to change notification settings - Fork 310
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
v2.36.2 fails webpack production builds #657
Comments
Hi @avatarneil - thanks for raising this and providing a reproduction For the moment, you can work around this by resolving
Please use this workaround for now while we try and find a better solution |
Hi @adamjmcgrath, thanks for the prompt response and workaround suggestion! Unfortunately, it seems that this workaround (while silencing the |
Looks like there's a couple of Webpack issues with resolve: {
alias: {
vm2: false
}
} Assuming you're not using a PAC proxy |
@avatarneil I'll try your repro tomorrow. |
I ran into this issue this morning. I can confirm that the following webpack config section allows the build to succeed.
Note I have similar issues with the auth0-deploy-cli throwing warnings. |
The problem child here is https://github.com/TooTallNate/node-degenerator . This is not a permanent solution if you use proxy in node-auth. This can leave you vulnerable, but if you are trying to push to prod and realize auth0 doesn't care that they've just broken then entire package for so many users. Well, you do what you need to do. We are using pkg and receive this error:
We attempted every recommendation provided by Vercel to include this as an asset. After further review the packages are just simply incompatible. Workaround is as follows:
in package.json add:
also add to package.json:
Save your package.json . After that, you will need to do the following in this exact order:
NOTE: We also had to change our build scripts to: Best of luck. Auth0 team. Please fix this, it's broken quite a few things for such a small sub-dependency. I'm sure others will be here to chime in, in the near future as well. |
Hi @CyberSecDemon - thanks for sharing this
We do care 😄 - this is just an issue with a downstream dependency that we don't have control over and refactoring it out will involve a large change to our networking stack that we're not ready to do yet. If you're running into the issue with Webpack as described in the original issue post, for now please use the workarounds suggested in the thread. |
hhm ok this also breaks my app at runtime (nodejs lambda, using auth0 management client), because of I'm using esbuild (to bundle everything into one file prior to deployment) and tried to add vm2 to externals of the esbuild config, which excludes it from bundling. I will try to downgrade auth0 and pin it to a specific version for now. EDIT: ok, downgrading auth0 does not work, because even So the only way i see is that rest-facade removes or downgrades the superagent-proxy dependency and releases a new minor or patch package, or auth0 is removing rest-facade or pinning it to 1.13.0. Kind of blocking my releases until we find a solution. |
i think this is just caused by this bug ngonzalvez/rest-facade#62. |
They have released 1.16.2, can you verify this solves your problem? |
wow that was fast. (rest-facade client code snippet)
I can not exclude superagent-proxy in general via the esbuild config, because I have another library (node-mailjet) which is using superagent-proxy@v2 (without vm2 down the tree) I will try to find other solutions today and get back here. |
Might also be more of a thing to discuss on their repository or on esbuild. |
For If you otherwise needs |
thanks for this post i fixed this ERORR: [!hexoid is not a function] |
Describe the problem
Attempting to create a production webpack build with the recently released Auth0 v2.36.2 results in quite a few warnings/errors being thrown, the most critical (and relevant to this issue) of which are:
and
After these errors are thrown, the webpack build fails.
What was the expected behavior?
Successful webpack build!
Reproduction
I made an example repo which reproduces this issue https://github.com/avatarneil/auth0-vm2-webpack-repro
Environment
Additional Details
Upon some investigation, it appears that Auth0 v2.36.2 introduced a dependency on https://github.com/patriksimek/vm2/. It appears that this dependency breaking webpack builds is a known issue (see patriksimek/vm2#68), and the maintainer of the package has been resistant to making any changes to fix this, simply stating that this package is not webpack compatible. Unfortunately, this is very far down in the dependency tree for Auth0; in order to resolve this issue, I think that
rest-facade
may need to be subbed out for another library which does not containvm2
anywhere in the dependency tree.I do hope that this issue can be resolved, as I am now forced to lock my auth0 version at an earlier version that does not contain this dependency... Of all the packages to keep up-to-date, I think this is one of the most important 😅
The text was updated successfully, but these errors were encountered: