Closed maryamaljanabi closed 1 year ago
Hi @maryamaljanabi - thanks for raising this
What version of Formidable
are you using in your project, can you do yarn why formidable
and share the result?
@adamjmcgrath Thanks for your response. I'm not using Formidable
directly but some of my packages depend on it. Here's the output of yarn why formidable
:
=> Found "formidable@2.1.1"
info Reasons this module exists
- "_project_#(my-folder-name)#auth0#rest-facade#superagent" depends on it
- Hoisted from "_project_#(my-folder-name)#auth0#rest-facade#superagent#formidable"
info Disk size without dependencies: "176KB"
info Disk size with unique dependencies: "532KB"
info Disk size with transitive dependencies: "1.12MB"
info Number of shared dependencies: 10
Hi @maryamaljanabi - could you share a repo that demonstrates the issue? I'm not able to reproduce it with the steps you've shared
Hi @adamjmcgrath thanks a lot for responding again. I could reproduce this issue on both Windows and Ubuntu. I'd appreciate any feedback on how to solve this. I get the error when running yarn start
and calling any endpoint that uses auth0
.
I also am having this problem. We are using 3.2.0 and run into the exact same problem on AWS Lambda, after disabling superagent-proxy like the Readme says.
I figured out a workaround @maryamaljanabi: https://github.com/auth0/node-auth0/issues/657#issuecomment-928083729 specifically what NotMyself commented on Sep 27, 2021.
Thank you for mentioning that @bxjw. Since I'm using serverless-bundle
package, I can't configure webpack but I found an option to disable Formidable
package in the serverless-bundle
settings based on the solution you suggested.
For anyone struggling with this issue while using serverless-bundle
, I had to disable Formidable
in the bundle settings. Just include the following in the custom
section of your serverless.yml
file:
custom:
bundle:
aliases:
- formidable: false
Another solution is to downgrade superagent
package from version 7 to 6 according to this solution https://github.com/node-formidable/formidable/issues/337#issuecomment-1118348077.
In my case, superagent
is a dependency of a dependency and I'm not using it directly so I had to downgrade it using yarn resolutions. I added the following to the package.json
file:
"resolutions": {
"superagent": "6.0.0"
}
I ended up going with the first solution and just disabling Formidable
in serverless-bundle
Update: Disabling Formidable
only worked offline but I encountered issues when deploying the serverless app. I solved it by adding Formidable
and superagent
as externals instead:
custom:
bundle:
externals:
- superagent-proxy
- formidable
Why has this issue been closed? This library clearly does not work properly in a node environemnt in a aws Lambda.
So many issues with node-auth0
to actually work in node
its incredible. A few months ago we were dealing with Superagent-proxy issues, got around that and now this which fine for the people who have control over Webpack configs you can solve it, but what for the res of us? This clearly is not a stable library given all the unnecessary issues developers need to deal with
I encountered issues:
finally #828 works fine for me(sls v1.67, Nodejs14), and watch out the serverless-bundle
version by the way, lower version may
cause failure.
I figured out a workaround @maryamaljanabi: #657 (comment) specifically what NotMyself commented on Sep 27, 2021.
thanks for this a link
i fixed this ERORR: [!hexoid is not a function]
i encountered the same issue when I used the formidable
Describe the problem
When running my nodejs serverless application that uses anything from
auth0
, I get the following error:What was the expected behavior?
The application should not throw an error and accessing the features of
auth0
package should be accessed without a problem.Reproduction
yarn add auth0 @types/auth0
yarn start
auth0
Environment
@types/auth0
: 3.3.0serverless
: 2.66.0serverless-bundle
: 5.0.2serverless-offline
: 8.2.0aws-sdk
: 2.684.0nodejs
tried all these versions but the error didn't go away (14.19.0, 16.17.0, 18.12.0)