Skip to content

Commit

Permalink
polish: improve template compiler version mismatch warning (vuejs#9738)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmillenb authored and Lostlover committed Dec 10, 2019
1 parent a0a69f0 commit a2af667
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/vue-template-compiler/index.js
Original file line number Diff line number Diff line change
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 a2af667

Please sign in to comment.