Skip to content

Commit

Permalink
polish: improve template compiler version mismatch warning (#9738)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmillenb authored and yyx990803 committed Mar 20, 2019
1 parent df4af4b commit bf5ceb7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/vue-template-compiler/index.js
Expand Up @@ -5,10 +5,12 @@ try {
var packageName = require('./package.json').name
var packageVersion = require('./package.json').version
if (vueVersion && vueVersion !== packageVersion) {
var vuePath = require.resolve('vue')
var packagePath = require.resolve('./package.json')
throw new Error(
'\n\nVue packages version mismatch:\n\n' +
'- vue@' + vueVersion + '\n' +
'- ' + packageName + '@' + packageVersion + '\n\n' +
'- vue@' + vueVersion + ' (' + vuePath + ')\n' +
'- ' + packageName + '@' + packageVersion + ' (' + packagePath + ')\n\n' +
'This may cause things to work incorrectly. Make sure to use the same version for both.\n' +
'If you are using vue-loader@>=10.0, simply update vue-template-compiler.\n' +
'If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump ' + packageName + ' to the latest.\n'
Expand Down

0 comments on commit bf5ceb7

Please sign in to comment.