Open mrispoli24 opened 5 years ago
@mrispoli24 Thank you so much for this! I was pulling my hair out for a couple of hours!!
@mrispoli24 Another grateful dev here, thank you for documenting this! Problem solved.
In my case it was the same issue with formidable
, but from auth0
rather than faunadb
.
I had been successfully using Netlify Dev to serve some self-contained functions locally (with no build steps) and had just set up netlify-lambda
so that I could build them from TypeScript source files instead. On building, I got the following warning:
WARNING in ../node_modules/formidable/lib/incoming_form.js 1:43-50
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
@ ../node_modules/formidable/lib/index.js
@ ../node_modules/superagent/lib/node/index.js
@ ../node_modules/rest-facade/src/Client.js
@ ../node_modules/rest-facade/src/index.js
@ ../node_modules/auth0/src/auth/index.js
@ ../node_modules/auth0/src/index.js
@ ./image-signature.ts
Using the application resulted in the same error TypeError: n is not a function
as reported by others on https://github.com/netlify/netlify-lambda/issues/64.
superagent need to upgrade formidable Please check out below
https://github.com/visionmedia/superagent/issues/1609 https://github.com/node-formidable/formidable/issues/337
I found an issue when trying to run this where I receive the error:
The fix for me was to add a
webpack.functions.js
file to the root with the following:In
package.json
the serve and build commands needed to add this per the documentation.This allowed this to compile properly without the error. Not sure if something changed in the formidable package or if anyone else has come across this.