Skip to content
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

cannot resolve module 'fs' #91

Closed
runarhk opened this issue Apr 19, 2016 · 7 comments
Closed

cannot resolve module 'fs' #91

runarhk opened this issue Apr 19, 2016 · 7 comments

Comments

@runarhk
Copy link

runarhk commented Apr 19, 2016

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...

@runarhk
Copy link
Author

runarhk commented Apr 19, 2016

Adding

node: {
console: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty'
}

to the webpack.base.conf.js fixes the problem

@chrisvfritz
Copy link
Contributor

@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).

@runarhk
Copy link
Author

runarhk commented Apr 26, 2016

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.

@chrisvfritz
Copy link
Contributor

@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. 😃

@chrisvfritz
Copy link
Contributor

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.

@tvld
Copy link

tvld commented Sep 14, 2016

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 )

@tvld tvld mentioned this issue Sep 14, 2016
@eroncastro
Copy link

Im my case, I found the solution here:
webpack-contrib/css-loader#447

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants