-
-
Notifications
You must be signed in to change notification settings - Fork 682
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
Frustrating warnings when used with webpack #337
Comments
Hi, Having same issue.
I'm importing
Does it tells something to someone ? |
For webpack user, adding :
fix the issue. |
@tdeheurles Just wanted to say thank you for this. Ran into this when packaging for Electron--was very frustrating. |
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
Adding
Duh.. that would break everything.. EDIT Clicked "Comment" too soon. |
this is still an issue |
yup still be, and I confirm :
Fix it |
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: alias: {
'inherits': 'inherits/inherits_browser.js',
'superagent': 'superagent/lib/client',
'emitter': 'component-emitter',
}, 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... |
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. |
Just ran into this and lost an hour's time trying to figure it out! |
I have the same issue |
Hi @benjie, I'm using superagent and still getting the error after adding the config in the webpack. Here's my webpack.config snippets:
Warning Notification:
Error Message:
|
@nazmy Sorry, can't help other than to suggest you try adding the aliases too? |
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 Basically, babel/webpack/whatever sees this line:
And I guess considers
This overwrites 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 |
Yep, it's about testing I believe. There are many things that should be aligned to the current state of javascript, tooling and work(/dev)flow. We already have opened the discussion, about converting tests to something like mocha. #415 |
Just got bit by the same very thing as most in here. I see that I have some dependencies on formidable with my Koa stuff:
Which was transforming into:
@tdeheurles and @gabrielstuff posted that you can fix this in your webpack config with:
This indeed worked. Webpack then outputs:
Since If this doesn't fix your |
This doesn't make the warning go away. However, when i update the required dependency |
Thanks to @chouch0u 's solution. // vue.config.js
module.exports = {
pluginOptions: {
electronBuilder: {
// List native deps here if they don't work
externals: ['formidable', 'koa-body'],
}
}
} |
Is there an update on this issue and v2 in general? We've been using |
@ilijapuaca Can you try again with version 3 ? It uses import/export syntax so should be better with webpack. |
for next js, the config file is different "next.config.js"
You can add packages that you don't want to include in the client, so you don't get the error:
|
@weaksou switch to v2 or v3. |
how I'm supposed to do this? I'm new to formidable 😄, thanks. |
@weaksou check the VERSION_NOTES file. In short, installing formidable as usual now installs the latest v2. The v3 is on v3 dist-tag |
Too old. Closing. |
For anyone else who is trying to investigate 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 |
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: const { NormalModuleReplacementPlugin } = require('webpack');
module.exports = {
...
plugins: [
...
new NormalModuleReplacementPlugin(/^hexoid$/, require.resolve('hexoid/dist/index.js')),
]
} |
Good afternoon, Please where am I supposed to input the above code? |
This worked for Next JS :)
|
webpack config also has |
I found this issue while using webpack for a server application, I used webpack-node-externals as For me the issue was the same, but in a different context, hope this help more than one. |
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! |
The text was updated successfully, but these errors were encountered: