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

## 対象

* Vue.jsとVue.jsに依存するライブラリ（ `vue-template-compiler` 、`vue-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-compiler` 、`vue-loader` などのVue.js関連ライブラリのマイナーバージョンが更新された場合などに、プロジェクトで使用するVue.jsのバージョンと不整合が生じると、上記のエラーが起こります。

## 対応

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

```
  "dependencies": {
    ・・・
    "vue": "^2.6.14",
    "vue-onsenui": "^2.6.4"
    ・・・
  },
  "devDependencies": {
     ・・・
    "vue-loader": "^15.9.8",
    "vue-template-compiler": "^2.6.14",
    ・・・
  }
```

↓

```
  "dependencies": {
    ・・・
    "vue": "2.6.14",
    "vue-onsenui": "2.6.4"
    ・・・
  },
  "devDependencies": {
     ・・・
    "vue-loader": "15.9.8",
    "vue-template-compiler": "2.6.14",
    ・・・
  }
```

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

![](/files/5uUNQhyMlMyevh69WVsP)

![](/files/KSmLEOK4JLhq6jhTlJUP)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ja.docs.monaca.io/toraburushtingu/purebyrogugarirdoworisu-vue-packages-version-mismatch-error.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
