You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WARNING in ./~/harmony/~/formidable/lib/incoming_form.js
Critical dependencies:
1:43-50 require function is used in a way, in which dependencies cannot be statically extracted
@ ./~/harmony/~/formidable/lib/incoming_form.js 1:43-50
WARNING in ./~/harmony/~/formidable/lib/incoming_form.js
Critical dependencies:
1:0-14 the request of a dependency is an expression
@ ./~/harmony/~/formidable/lib/incoming_form.js 1:0-14
WARNING in ./~/harmony/~/formidable/lib/file.js
Critical dependencies:
1:43-50 require function is used in a way, in which dependencies cannot be statically extracted
@ ./~/harmony/~/formidable/lib/file.js 1:43-50
WARNING in ./~/harmony/~/formidable/lib/file.js
Critical dependencies:
1:0-14 the request of a dependency is an expression
@ ./~/harmony/~/formidable/lib/file.js 1:0-14
WARNING in ./~/harmony/~/formidable/lib/querystring_parser.js
Critical dependencies:
1:43-50 require function is used in a way, in which dependencies cannot be statically extracted
@ ./~/harmony/~/formidable/lib/querystring_parser.js 1:43-50
WARNING in ./~/harmony/~/formidable/lib/querystring_parser.js
Critical dependencies:
1:0-14 the request of a dependency is an expression
@ ./~/harmony/~/formidable/lib/querystring_parser.js 1:0-14
WARNING in ./~/restify/~/formidable/lib/incoming_form.js
Critical dependencies:
1:43-50 require function is used in a way in which dependencies cannot be statically extracted
@ ./~/restify/~/formidable/lib/incoming_form.js 1:43-50
WARNING in ./~/restify/~/formidable/lib/file.js
Critical dependencies:
1:43-50 require function is used in a way in which dependencies cannot be statically extracted
@ ./~/restify/~/formidable/lib/file.js 1:43-50
WARNING in ./~/restify/~/formidable/lib/json_parser.js
Critical dependencies:
1:43-50 require function is used in a way in which dependencies cannot be statically extracted
@ ./~/restify/~/formidable/lib/json_parser.js 1:43-50
WARNING in ./~/restify/~/formidable/lib/querystring_parser.js
Critical dependencies:
1:43-50 require function is used in a way in which dependencies cannot be statically extracted
@ ./~/restify/~/formidable/lib/querystring_parser.js 1:43-50
I'm importing restify that uses formidable.
Compiling with webpack generate an issue :
var crypto = require('crypto');
^
TypeError: undefined is not a function
Does it tells something to someone ?
Running var crypto = require('crypto'); in my code does not generate that problem.
Reacted by Gitowiec, Furkan Tunalı and Param Singh
plugins: [
new webpack.DefinePlugin({ "global.GENTLY": false })
],
fix the issue.
Reacted by Aaron Tribou, Brendan McLoughlin, Ramiro Silveyra d'Avila, Kevin Wade, Gustavo Perdomo, Juorder Gonzalez, Andrés Santibáñez, Masious, Johannes Fischer, Sallar and 95 more
Reacted by Marko Matić, Davis Koh, Jendrik Guse, tigie11, Kuznetsov Dmitriy, Daniel De Lucca Fonseca, yzk10086, Vicary, Alex Styl, Cristian Sima and 3 more
Reacted by Steven Haddix, Dor Tzur, Mostafa Sholkamy, Vlad Frolov, Russ Beye, Matthew, David Furlong, Anton Startsev, Nicolas, Furkan Tunalı and 20 more
Reacted by Calum MacRae, Peter Lyons, tinutomson, Matthew, Anton Startsev, Nicolas, Furkan Tunalı, Daniel Haus, Cristóbal Valenzuela, Juan A. Macías and 15 more
Apologies for polluting the thread, but for anyone landing on this and still having issues afterwards who happens to be using superagent, note they have a wiki page saying what to do
[...] you can either use superagent's browser version directly (require('superagent/lib/client')), or fix your Webpack settings:
This cost me more time than I'd like to admit (oh look at that, it's just gone midnight), so posting here in the hopes it helps someone else since I landed on this page early on in my search...
Reacted by dev101, Domas Lasauskas, Edo Rivai, wyqydsyq, Nikolay Kuchumov, Vlad Frolov, Savas Vedova, aksel, gg, HuangLiangchen and 11 more
Reacted by Savas Vedova, gg and pvadhiya
Reacted by Savas Vedova, ylaintsaurent, Josh Lloyd, pvadhiya and Libor Kuchejda
Reacted by Savas Vedova, pvadhiya, David Jones, Troy Cosentino and Dan Bruder
WARNING in ./~/formidable/lib/incoming_form.js
Critical dependencies:
1:43-50 require function is used in a way in which dependencies cannot be statically extracted
@ ./~/formidable/lib/incoming_form.js 1:43-50
WARNING in ./~/formidable/lib/file.js
Critical dependencies:
1:43-50 require function is used in a way in which dependencies cannot be statically extracted
@ ./~/formidable/lib/file.js 1:43-50
WARNING in ./~/formidable/lib/json_parser.js
Critical dependencies:
1:43-50 require function is used in a way in which dependencies cannot be statically extracted
@ ./~/formidable/lib/json_parser.js 1:43-50
WARNING in ./~/formidable/lib/querystring_parser.js
Critical dependencies:
1:43-50 require function is used in a way in which dependencies cannot be statically extracted
@ ./~/formidable/lib/querystring_parser.js 1:43-50
Error Message:
Type Error ---------------------------------------------
require is not a function
Been dealing w/ this for a few hours & no luck w/ any of the existing solutions. The problem for me is a bit diff't though: I'm using an electron boilerplate with preconfig'd babel/webpack, and one of the plugins somewhere is doing something strange here.
Basically, babel/webpack/whatever sees this line:
if (global.GENTLY) require = GENTLY.hijack(require);
And I guess considers require to need declaring, so it outputs it as:
var require;if (global.GENTLY) require = GENTLY.hijack(require);
This overwrites global.require & breaks everything else in the file.
Still trying to sort out which plugin is screwing it up, but unfortunately removing plugins one-by-one requires extensive fiddling w/ other things to make the project even start.
It seems like this one line is causing a lot of heartache, esp. since auth0 depends indirectly on this lib.
Does this line need to be required in exactly this way? If it's for testing, can't you set NODE_ENV='test' & wrap this?
@weaksou check the VERSION_NOTES file. In short, installing formidable as usual now installs the latest v2. The v3 is on v3 dist-tag npm install formidable@v3. The npm dist-tag will change soon too but that doesn't matter that much.
For anyone else who is trying to investigate TypeError: hexoid is not a function and found out that this is the only thread in the entire Internet about the issue: downgrade your superagent (or similar library that uses formidable).
I went from 7 to 6 and that fixed the issue. Looking at the changelog, there's a formidable update mentioned.
Reacted by Josh Merritt, Pheakdey Yi, David Glivar, Max Waibel, Aaron Pittenger, James Warwood, David Goemans and Maryam
For anyone else who is trying to investigate TypeError: hexoid is not a function and found out that this is the only thread in the entire Internet about the issue: downgrade your superagent (or similar library that uses formidable).
I went from 7 to 6 and that fixed the issue. Looking at the changelog, there's a formidable update mentioned.
I had to downgrade soap to version 0.43.0 to get this error to go away
Reacted by Phillip Whitaker, Riccardo Gueli Alletti and Jira15
I found another solution which doesn't require you to downgrade, but this only works if you're working with webpack. Add this to your webpack config file:
Reacted by Sibelius Seraphini, James Alfei, Sebastian Frysztak, Beatriz Oliveira, Slawa P., Kevin Schlenker, Matthew Stevens, 郭浩伟, Charlie Greenman , Xinsong and 5 more
Reacted by dio-trinny
Reacted by Beatriz Oliveira, Chris Norwood, Angus Ryer, dio-trinny and Ruben
I found another solution which doesn't require you to downgrade, but this only works if you're working with webpack. Add this to your webpack config file:
I tried build a clean new project only with express and formidable, it works. But when I build a electron project by Vue/Cli and Vue-electron try require formidable on main.js (or background.js ) it shows up this error:
App threw an error during load
TypeError: hexoid is not a function
Must be something wrong with webpack or vue or electrons build system.
And I find the solution, Add formidable to externals on vue.config.js under the electronBuilder option. Anyone try to use formidable at vue-electron project should try this.
// vue.config.jsmodule.exports={pluginOptions: {electronBuilder: {// List native deps here if they don't workexternals: ['formidable'],}}}
webpack config also has externals prop, just mentioning
I found this issue while using webpack for a server application, I used webpack-node-externals as externals: [webpackNodeExternals()],docs here. This allows the bundle file to has node dependencies included.
For me the issue was the same, but in a different context, hope this help more than one.
Activity
tdeheurles commentedon Nov 3, 2015
Hi, Having same issue.
I'm importing
restifythat usesformidable.Compiling with webpack generate an issue :
Does it tells something to someone ?
Running
var crypto = require('crypto');in my code does not generate that problem.tdeheurles commentedon Nov 3, 2015
For webpack user, adding :
fix the issue.
quicksnap commentedon Dec 7, 2015
@tdeheurles Just wanted to say thank you for this. Ran into this when packaging for Electron--was very frustrating.
quicksnap commentedon Dec 8, 2015
Looking at the webpack output, this issue could most likely be fixed by changing this line: https://github.com/felixge/node-formidable/blob/master/lib/incoming_form.js#L1
to something like this:
Adding
var requirewill prevent Webpack from shadowing the actual require with an emptyvar require;before theif (global.GENTLY).Would a PR like that be accepted?Duh.. that would break everything..
EDIT Clicked "Comment" too soon.
davis commentedon Feb 10, 2016
this is still an issue
gabrielstuff commentedon Feb 12, 2016
yup still be, and I confirm :
Fix it
benjie commentedon Dec 2, 2016
Apologies for polluting the thread, but for anyone landing on this and still having issues afterwards who happens to be using superagent, note they have a wiki page saying what to do
I also added the following, for good measure:
This cost me more time than I'd like to admit (oh look at that, it's just gone midnight), so posting here in the hopes it helps someone else since I landed on this page early on in my search...
tunnckoCore commentedon Jan 16, 2017
Yea, that definitely a problem of how whole library is written. And kind of sucks. I believe we could change it and improve it for v2 release.
isaachinman commentedon Apr 7, 2017
Just ran into this and lost an hour's time trying to figure it out!
joseSantacruz commentedon Apr 15, 2017
I have the same issue
nazmy commentedon Apr 21, 2017
Hi @benjie, I'm using superagent and still getting the error after adding the config in the webpack.
I'm using webpack 2.4.1.
Here's my webpack.config snippets:
Warning Notification:
Error Message:
benjie commentedon Apr 21, 2017
@nazmy Sorry, can't help other than to suggest you try adding the aliases too?
brandonmp commentedon May 3, 2017
Been dealing w/ this for a few hours & no luck w/ any of the existing solutions. The problem for me is a bit diff't though: I'm using an
electronboilerplate with preconfig'd babel/webpack, and one of the plugins somewhere is doing something strange here.Basically, babel/webpack/whatever sees this line:
And I guess considers
requireto need declaring, so it outputs it as:This overwrites
global.require& breaks everything else in the file.Still trying to sort out which plugin is screwing it up, but unfortunately removing plugins one-by-one requires extensive fiddling w/ other things to make the project even start.
It seems like this one line is causing a lot of heartache, esp. since auth0 depends indirectly on this lib.
Does this line need to be required in exactly this way? If it's for testing, can't you set
NODE_ENV='test'& wrap this?52 remaining items
tunnckoCore commentedon Nov 23, 2021
@weaksou check the VERSION_NOTES file. In short, installing formidable as usual now installs the latest v2. The v3 is on v3 dist-tag
npm install formidable@v3. The npm dist-tag will change soon too but that doesn't matter that much.tunnckoCore commentedon Apr 3, 2022
Too old. Closing.
ahoys commentedon May 5, 2022
For anyone else who is trying to investigate
TypeError: hexoid is not a functionand found out that this is the only thread in the entire Internet about the issue: downgrade your superagent (or similar library that uses formidable).I went from 7 to 6 and that fixed the issue. Looking at the changelog, there's a formidable update mentioned.
jjmerri commentedon Jun 29, 2022
I had to downgrade
soapto version0.43.0to get this error to go awaydhruvit-r commentedon Jul 30, 2022
I found another solution which doesn't require you to downgrade, but this only works if you're working with webpack. Add this to your webpack config file:
skaraudio commentedon Sep 22, 2022
This worked for Next JS :)
downgrade superagent to v6.1.0 to resolve hexoid lib linking issue (#143
Josh-a-e commentedon Mar 13, 2023
Having recently come across this same issue, I eventually discovered this fixed it
PSoltes commentedon Mar 13, 2023
webpack config also has
externalsprop, just mentioningca-santiago commentedon Apr 9, 2023
I found this issue while using webpack for a server application, I used webpack-node-externals as
externals: [webpackNodeExternals()],docs here. This allows the bundle file to has node dependencies included.For me the issue was the same, but in a different context, hope this help more than one.
oyatek commentedon May 13, 2024
thank you so much. I would've never found this by myself, Google/StackOF/GH_Copilot had no clue how to fix it. Only you did!