tanaka's Programming Memo

プログラミングについてのメモ。

Vue 2.1.7 にしたら webpack でエラーが発生した

Vueを2.1.7にバージョンアップしたら、以下のようなエラーが発生しました。

Error: ./resources/assets/js/components/Modal.vue
Module build failed: Error: 

Vue packages version mismatch:

- vue@2.1.7
- vue-template-compiler@2.1.6

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-compiler のバージョンが不一致とのことです。 vue-loader の Ver10.0 以上を利用している場合は、 vue-template-compiler をアップデート。 vue-loader の Ver10.0 未満や vueify を使っている場合は、それらを再インストールして、 vue-template-compiler を最新版にするようにとのこと。

自分の環境では多分何も利用してなさそうだったので、単純に vue-template-compiler を以下でプロジェクトにインストールして解決しました。

npm install --save-dev vue-template-compiler

laravel-elixir-vue-2 あたりがバージョンアップしたら npm update だけで問題は発生しなくなるかもしれませんが、とりあえず現場での対処法でした。