LoginSignup
1
1

More than 3 years have passed since last update.

NuxtをアップデートするとForkTsCheckerWebpackPluginがエラーを出す件

Posted at

dev起動時にエラー

以前つくったNuxtプロジェクトのライブラリを更新したところ、
devでの起動時に、ForkTsCheckerWebpackPluginのエラーで止まってしまった。

Invalid configuration object. ForkTsCheckerWebpackPlugin has been initialized using a configuration object that does not match the API schema.
 - configuration.eslint should be an object:
   object { files, enabled?, memoryLimit?, options?, … }

  - configuration.eslint should be an object:
  object { files, enabled?, memoryLimit?, options?, … }
  at Object.validate [as default] (node_modules/fork-ts-checker-webpack-plugin/node_modules/schema-utils/dist/validate.js:96:11)
  at new ForkTsCheckerWebpackPlugin (node_modules/fork-ts-checker-webpack-plugin/lib/ForkTsCheckerWebpackPlugin.js:31:31)
  at WebpackBundler.<anonymous> (node_modules/@nuxt/typescript-build/dist/index.js:41:27)
  at next (node_modules/@nuxt/utils/dist/utils.js:659:27)
...

原因と解決方法

調べてみると、nuxt.config.jsの中で、typescript部分の記述方法が変わっていたことが原因だった。

古い指定

export default {
  typescript: {
    typeCheck: {
      eslint: true
    }
  }
}

現在の指定

export default {
  typescript: {
    typeCheck: {
      eslint: {
        files: './src/**/*.{ts,js,vue}'
      }
    }
  }
}

新しい指定方法に記述を変更すると解決。

破壊的な変更はちゃんとチェックしてね

「バージョンアップする時は破壊的な変更をちゃんとチェックしろ」ということだそうです。
そりゃそうなんですけどね。
マニュアルに「ここの指定、前と変わったよ」と一言書いといてくれてもいいのに。

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