-
-
Notifications
You must be signed in to change notification settings - Fork 605
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
Can't resolve 'fs' when bundle with webpack #447
Comments
same here |
1 similar comment
same here |
Same for me, had to rollback that update |
same here |
Adding node: {
fs: 'empty'
} to webpack config file and the error is gone. Not sure how it works, It seems like webpack did some thing with |
add the following to your Webpack config: node: {
fs: "empty"
} |
The issue has been acknowledged and we are in process of figuring out a good fix. No need for "me too"s. Please add a thumbs up on the original issue if you want to do that. 👍 |
Did you can to unpublish this version? It will keep calm to all of us |
@PredokMiF You don't unpublish anything, ever. The workaround is sufficient and the bug is actually in webpack, related to WORKAROUND thanks to @hdnha11 / @mehdivk
If using this workaround isn't viable, version lock to the previous minor version. |
@bebraw With your fix of this issue, I have a |
@fklingler I have a proposed fix for that at #453 . Still waiting for some approvals before I can push it. Feel free to give that a go and let me know how it goes. |
I came across the same error. I am starting off with JS (with vuejs) and I would like to understand what this does? I got this error when using the "fetch" library from npm. At first I got the same error but with other packages ( I now added two sections in my webpack config for both But I don't know what this entails. Will my compiled code still work? Even if these sections are configured as being Also, is this the right place to ask this? Or should it be rather targeted at vuejs? nb: I would like to give a bit more insight about my running environment but as I'm still getting my feet wet, I don't know which commands are the best to represent a snapshot of my dev-environment. If you need some additional output, let me know which commands to run. |
@exhuma See the related page on documentation. That describes the default behavior. You can also find possible overrides there. I hope this helps.
Stack Overflow might be better for this type of questions. |
just wanted to add that I fixed this by the answer in josephsavona/valuable#9 about setting This explains more: http://jlongster.com/Backend-Apps-with-Webpack--Part-I
|
Hi - when I did the error went away. Then I got so I fixed it with Then I got a GetEnv error saying SERVER_HOST not defined... but it is... so there's a slew of errors that I'm swimming in - I hope someone can take a look at my boilerplate and give me hand? Thank you! |
I fixed the problem by changing webpack.config.js: ... and: |
Someone please fix this issue. Non of the mentioned answer could fix it for me |
The fs module in the dependancy was causing issue due to the [webpack issue](webpack-contrib/css-loader#447 (comment)) in handling of the fs module
For //webpack.config.js
module.exports = {
...
resolve: {
fallback: {
"fs": false
},
}
} |
For me (webpack with electron) the problem was apparently that I was doing |
@majidgh72
|
Thanks @majidgh72, the migration to webpack 5 talks about |
@Powersource Should be work without any problems on v5 https://github.com/webpack/webpack/blob/0c4d47a987f3688c663c7a7e18fe8e277e6f98c8/lib/node/NodeTargetPlugin.js#L27 |
Got this error.
on Doing
|
Because JavaScript can be written for both server and browser, webpack offers multiple deployment targets that you can set in your webpack configuration. Just add to your webpack.config following line: |
@alexjavascript If you are using webpack to build the Node server and the content in the same project as different entries, how do you distinguish the target for each entry? |
How can we configure that for running with karma, so that we can test with empty or simulated modules? So we tried some stuff already including browserify, node-polyfill-webpack-plugin, node-karma, ts-node, changing targets, and maybe I forgot one or the other. Still no luck running the tests unless we split the node-core using code into its own project, which we would like to avoid. We have such panels running on Angular 9, and these tests run just fine... (The Angular 12 panel also runs fine inside premiere-pro, only the tests cannot be executed.) We also tried loading the webpack config and inserting it into the karma.conf:
and later in the config:
And here is a project which could be used as a starting point if anyone wants to try :) |
Fixed by adding |
package.json add
|
For Webpack 4, you need to add this in
For Webpack 5, you need to add this in
|
|
I've upgraded to vite from webpack but I am getting same issue with Nx in webstorm
|
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Webpack finish bundle without errors with css-loader
0.26.4
.After update to
0.27.0
webpacking finished with error:If the current behavior is a bug, please provide the steps to reproduce.
0.26.4
to0.27.0
versionWhat is the expected behavior?
Works without error
Please mention other relevant information such as your webpack version, Node.js version and Operating System.
Windows 8.1
Node.js 7.7.2
Webpack 2.2.1
The text was updated successfully, but these errors were encountered: