Skip to content

Commit bf5ceb7

Browse files
mcmillenbyyx990803
authored andcommitted
polish: improve template compiler version mismatch warning (#9738)
1 parent df4af4b commit bf5ceb7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/vue-template-compiler/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ try {
55
var packageName = require('./package.json').name
66
var packageVersion = require('./package.json').version
77
if (vueVersion && vueVersion !== packageVersion) {
8+
var vuePath = require.resolve('vue')
9+
var packagePath = require.resolve('./package.json')
810
throw new Error(
911
'\n\nVue packages version mismatch:\n\n' +
10-
'- vue@' + vueVersion + '\n' +
11-
'- ' + packageName + '@' + packageVersion + '\n\n' +
12+
'- vue@' + vueVersion + ' (' + vuePath + ')\n' +
13+
'- ' + packageName + '@' + packageVersion + ' (' + packagePath + ')\n\n' +
1214
'This may cause things to work incorrectly. Make sure to use the same version for both.\n' +
1315
'If you are using vue-loader@>=10.0, simply update vue-template-compiler.\n' +
1416
'If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump ' + packageName + ' to the latest.\n'

0 commit comments

Comments
 (0)