From a3b65cd17f81a6a3e95329112dfda5bfde7d2eb1 Mon Sep 17 00:00:00 2001 From: Brian McMillen Date: Mon, 18 Mar 2019 08:47:17 -0400 Subject: [PATCH 1/2] build(build error message): Add the path of the resolved vue package to the "package version mismatc In the case that, when building the vue-template-compiler package, the resolved vue package is found to have a different version than the vue-template-compiler package, add the full path of the resolved vue package to the resulting error message. This will allow developers to quickly determine where the problematic vue package is located on their machine. --- packages/vue-template-compiler/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/vue-template-compiler/index.js b/packages/vue-template-compiler/index.js index 287d281738e..fdf4b40f6e0 100644 --- a/packages/vue-template-compiler/index.js +++ b/packages/vue-template-compiler/index.js @@ -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'); throw new Error( '\n\nVue packages version mismatch:\n\n' + '- vue@' + vueVersion + '\n' + '- ' + packageName + '@' + packageVersion + '\n\n' + + 'Path to vue package: ' + vuePath + '\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' From 69165691f25f756a763d8d13bb9edba4007e0b03 Mon Sep 17 00:00:00 2001 From: Brian McMillen Date: Tue, 19 Mar 2019 15:15:31 -0400 Subject: [PATCH 2/2] build(packages/vue-template-compiler/index.js): Update the vue-template-compiler version mismatch er re #9734 --- packages/vue-template-compiler/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/vue-template-compiler/index.js b/packages/vue-template-compiler/index.js index fdf4b40f6e0..dcc7e6cbe9c 100644 --- a/packages/vue-template-compiler/index.js +++ b/packages/vue-template-compiler/index.js @@ -5,12 +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 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' + - 'Path to vue package: ' + vuePath + '\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'