Added lokijs to dependency for my project, and when attempting to build I get "Module not found: Error: Cannot resolve module 'fs'". This is related to the setup by this template as it worked in my old setup...
Adding
node: {
console: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty'
}
to the webpack.base.conf.js fixes the problem
@runarhk Thanks for sharing this! Can you explain a little more about the implications of a change like this? I understand it's creating an empty mock of these node modules, but after looking at the docs, I'm still unsure why or when this is necessary. I'm also not sure what potential problems mocking these modules could cause (I imagine there's probably a reason it's not default behavior).
Sorry, but I am still learning the loops in webpack. I had a problem, googled it and found a solution that worked for me. I am not able to explain more about the implications, but it would be nice if you guys had a look at it.
@runarhk Thanks for the follow-up! I'm a Webpack power user, but by no means a complete Webpack expert, so I'll leave this open with the help wanted tag until someone can enlighten us. 馃槂
Since this issue has been stale for a while and no one else has reported it, I'm closing for now. Happy to reopen pending new information or others indicating that it's a problem for them as well.
Still getting this problem as well:
Module not found: Error: Cannot resolve module 'fs'.
When I run some script with node test.js module fs works perfectly. So with vue I can not use fs !! I actually think this is a breaking bug for vue.
On Gitter @dodas mentioned it works on prod, jsut not on dev. Did not test prod myself
(Ubuntu 16.04 / npm 3.10.3 node v6.4.0 )
Im my case, I found the solution here:
https://github.com/webpack-contrib/css-loader/issues/447
Most helpful comment
Still getting this problem as well:
When I run some script with node test.js module fs works perfectly. So with vue I can not use fs !! I actually think this is a breaking bug for vue.
On Gitter @dodas mentioned it works on prod, jsut not on dev. Did not test prod myself
(Ubuntu 16.04 / npm 3.10.3 node v6.4.0 )