LoginSignup
18
6

More than 1 year has passed since last update.

Nuxt.jsでModule not found: Error: Can't resolve 'fs' in ' エラーが出た時の対処法

Last updated at Posted at 2020-03-31

Nuxt.jsで外部ライブラリを導入後Module not found: Error: Can't resolve 'fs' in ' と言うエラーでコンパイルできず。

対処した方法

nuxt.config.js
export default {
  build: {
    extend (config, ctx) {
      config.node = {
        fs: "empty" 
      }
    }
  }
}

nuxt.config.jsに上記を追記することでコンパイルできました。

18
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
6