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

webpack throw erorr about 'fs' module #9

Closed
asfktz opened this issue Nov 30, 2014 · 7 comments
Closed

webpack throw erorr about 'fs' module #9

asfktz opened this issue Nov 30, 2014 · 7 comments

Comments

@asfktz
Copy link

asfktz commented Nov 30, 2014

while building with webpack, I'm getting this error:

ERROR in ./~/valuable/~/lazy.js/lazy.node.js
Module not found: Error: Cannot resolve module 'fs' 
  in /Users/asafkatz/Documents/dev/react-cart/node_modules/valuable/node_modules/lazy.js
@ ./~/valuable/~/lazy.js/lazy.node.js 1:13-26

it happens even if I just call:

var Valuable = require('valuable');

using the latest version: 0.3.2

for what its worth, this is my webpack.config.js file

// webpack.config.js
module.exports = {
    entry: './app/app.jsx',
    output: {
        path : './app',
        filename: 'bundle.js',
    },
    cache : true,
    watch : true,
    devtool: "eval",
    module: {
        loaders: [
            {
                test: /\.jsx$/,
                loader: 'jsx-loader?harmony'
            }
        ]
    },
    resolve : {
        extensions : ['', '.js', '.jsx']
    }
};

@josephsavona
Copy link
Owner

Seems similar to pugjs/pug-loader#8 (comment) - try adding

node: {
  fs: "empty"
}

to your webpack config

@amypellegrini
Copy link

I had this problem with webpack, but I solved adding:

target: 'node',

to my webpack.config.js as described here

@tbogatchev
Copy link

tbogatchev commented May 25, 2017

I'm still receiving the fs module error after adding target: 'node' and node: {fs: 'empty'}, any other ideas?
Running node 7.9.0
Webpack 2.3.3

@josephsavona
Copy link
Owner

I'm no longer maintaining this repository. I'd suggest alternate approaches to state management - Redux is great, I'm less familiar w Mobx but it is conceptually closer to valuable.

@amedley
Copy link

amedley commented Jul 7, 2017

Don't target: 'node' AND node: {fs: 'empty'}
Only target: 'node', do not do both.

@vurumadla
Copy link

i am facing this issue during building through dev.js. can anyone sugegst the solution.

WARNING in .//ipfs-js//ipfs-api/dist/ipfsapi.min.js
Critical dependencies:
1:461-468 This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.
@ .//ipfs-js//ipfs-api/dist/ipfsapi.min.js 1:461-468

ERROR in .//ipfs-api/lib/get-files-stream.js
Module not found: Error: Cannot resolve module 'fs' in /home/centos/PrivateSecurities1/node_modules/ipfs-api/lib
@ ./
/ipfs-api/lib/get-files-stream.js 33:11-24

ERROR in .//glob/glob.js
Module not found: Error: Cannot resolve module 'fs' in /home/centos/PrivateSecurities1/node_modules/glob
@ ./
/glob/glob.js 43:9-22

ERROR in .//glob/sync.js
Module not found: Error: Cannot resolve module 'fs' in /home/centos/PrivateSecurities1/node_modules/glob
@ ./
/glob/sync.js 4:9-22

ERROR in .//ipfs-merkle-dag/lib/dag-node.js
Module not found: Error: Cannot resolve module 'fs' in /home/centos/PrivateSecurities1/node_modules/ipfs-merkle-dag/lib
@ ./
/ipfs-merkle-dag/lib/dag-node.js 9:9-22

ERROR in .//fs.realpath/index.js
Module not found: Error: Cannot resolve module 'fs' in /home/centos/PrivateSecurities1/node_modules/fs.realpath
@ ./
/fs.realpath/index.js 8:9-22

@mihail-hrushev
Copy link

I found my answer for such issues here :
https://jlongster.com/Backend-Apps-with-Webpack--Part-I

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

No branches or pull requests

7 participants