jeremyfa / yaml.js

Standalone JavaScript YAML 1.2 Parser & Encoder. Works under node.js and all major browsers. Also brings command line YAML/JSON conversion tools.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Module not found: Error: Can't resolve 'fs'

ravitej177 opened this issue · comments

on webpacker compilation it is returning " Module not found: Error: Can't resolve 'fs' "

Module not found: Error: Can't resolve 'fs' in /node_modules/yamljs/lib'
@ ./node_modules/yamljs/lib/Utils.js 274:11-20
@ ./node_modules/yamljs/lib/Yaml.js

add this to your config:

node: {
fs: "empty"
}

thanks @SimonaMitrenova

here's what I had to do with laravel-mix:

mix.webpackConfig({
  node: {
    fs: 'empty'
  }
});

Thanks @Remo , looking for that fix for awhile now.

add this to your config:

node: {
fs: "empty"
}

which config didn't get

Can you let me know where should I add it on Angular 10?

this isn't a real solution

Svelte config:

module.exports = {
  compilerOptions: {
    namespace: "foreign"
  },
  preprocess: [ sveltePreprocess(), svelteNativePreprocessor() ],
  webpackConfig: {
    node: {
      fs: "empty"
    }
  }