プレビューログがリロードを繰り返す (Vue packages version mismatch error)

対象

  • Vue.jsとVue.jsに依存するライブラリ( vue-template-compilervue-loader など)を使用し、package.json でバージョンを固定していないプロジェクト。

事象

下記のエラーにより、プレビューログがリロードを繰り返す事象が発生します。

[webpack-cli] Error:

Vue packages version mismatch:

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.

原因

  • vue-template-compilervue-loader などのVue.js関連ライブラリのマイナーバージョンが更新された場合などに、プロジェクトで使用するVue.jsのバージョンと不整合が生じると、上記のエラーが起こります。

対応

  • package.json を開き、devDependencies 及び dependencies に定義されているVue.js、関連ライブラリのバージョンから ^ を外してバージョンを固定します。

  • プレビューログより、プロジェクトの再構成を実行します。

最終更新

役に立ちましたか?