I get warnings while bundling and a crash when running a webpack bundle with target 'node'.
webpack.config.js:
export default {
name: 'server',
target: 'node',
...
}
Bundling warnings:
WARNING in ./~/superagent/~/formidable/lib/incoming_form.js
Critical dependencies:
3:43-50 require function is used in a way in which dependencies cannot be statically extracted
@ ./~/superagent/~/formidable/lib/incoming_form.js 3:43-50
WARNING in ./~/superagent/~/formidable/lib/file.js
Critical dependencies:
3:43-50 require function is used in a way in which dependencies cannot be statically extracted
@ ./~/superagent/~/formidable/lib/file.js 3:43-50
WARNING in ./~/superagent/~/formidable/lib/json_parser.js
Critical dependencies:
3:43-50 require function is used in a way in which dependencies cannot be statically extracted
@ ./~/superagent/~/formidable/lib/json_parser.js 3:43-50
WARNING in ./~/superagent/~/formidable/lib/querystring_parser.js
Critical dependencies:
3:43-50 require function is used in a way in which dependencies cannot be statically extracted
@ ./~/superagent/~/formidable/lib/querystring_parser.js 3:43-50
Crash when bundle is run:
var fs = require('fs');
^
TypeError: undefined is not a function
sounds like some webpack issue. Maybe ask them to help
I'm having this same issue. Seeing this when i try using superagent. Any luck with this issue? @vlinder
You can try to fix that issue by adding
plugins: [
new webpack.DefinePlugin({ "global.GENTLY": false })
],
to your webpack config
That is what solved my problem.
@tdeheurles do you mind sharing the rest of your config? I'm still running into this issue
I'll try to find... I鈥檓 not sure the project is fine. I can鈥檛 remind but maybe it鈥檚 the one where I finished with babel-cli ...
@davis sorry, have looked to my commit and I can鈥檛 find ... Do you run targeting node ?
I got around it by removing some lines from the bundle after building. Inconvenient, but works for now. Thanks though!
Most helpful comment
You can try to fix that issue by adding
to your webpack config