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

Error with library fs #28

Closed
devgenerate opened this issue Jul 26, 2017 · 3 comments
Closed

Error with library fs #28

devgenerate opened this issue Jul 26, 2017 · 3 comments

Comments

@devgenerate
Copy link

Hello, I'm getting this error and I can't start my application,

ERROR in ./node_modules/pixi-sound/lib/Sound.js Module not found: Error: Can't resolve 'fs' in '/Users/davidh/Documents/Jobs/XXXX/node_modules/pixi-sound/lib' resolve 'fs' in '/Users/davidh/Documents/Jobs/XXXX/node_modules/pixi-sound/lib' Parsed request is a module using description file: /Users/davidh/Documents/Jobs/XXXX/node_modules/pixi-sound/package.json (relative path: ./lib) Field 'browser' doesn't contain a valid alias configuration

I tried installing fs and doesn't work, I added this configuration to the webpack and continue without working

target: 'node' node: { fs: 'empty' }

@bigtimebuddy
Copy link
Member

Thanks for the tip. This has been resolved in v2.0.0-alpha (replaced Browserify with Rollup) and does a better job using fs.

@devgenerate
Copy link
Author

I installed the v2.0.0-alpha and continue with the same error. Is necessary an aditional configuration? Thanks

ERROR in ./node_modules/pixi-sound/dist/pixi-sound.es.min.js Module not found: Error: Can't resolve 'fs' in '/Users/davidh/Documents/Jobs/Victory/6051-T4L/node_modules/pixi-sound/dist' resolve 'fs' in '/Users/davidh/Documents/Jobs/Victory/6051-T4L/node_modules/pixi-sound/dist' Parsed request is a module using description file: /Users/davidh/Documents/Jobs/Victory/6051-T4L/node_modules/pixi-sound/package.json (relative path: ./dist) Field 'browser' doesn't contain a valid alias configuration after using description file: /Users/davidh/Documents/Jobs/Victory/6051-T4L/node_modules/pixi-sound/package.json (relative path: ./dist)

@bigtimebuddy bigtimebuddy reopened this Jul 26, 2017
@bigtimebuddy
Copy link
Member

bigtimebuddy commented Jul 26, 2017

I was able to suppress this error by changing my Webpack configuration. Here's an example:

module.exports = {
    entry: './src/index.js',
    output: {
        path: __dirname + '/dist',
        filename: 'bundle.js'
    },
    node: {
        fs: "empty"
    }
};

The important bit is

node: {
    fs: "empty"
}

Reference josephsavona/valuable#9 (comment)

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

2 participants