vetur: 0.6.1 - Vue packages version mismatch

After upgrading to 0.6.1, I am having a different issue than the other ones posted thus far. The language server crashes with this error stating the the vue and vue-template-compiler are mismatched versions. I also tried removing and reinstalling the extension to update the dependencies to match, but the mismatch still happens, so it must be an issue with a package.json file somewhere.

/home/frankdugan3/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/vue-template-compiler/index.js:8
  throw new Error(
  ^

Error: 

Vue packages version mismatch:

- vue@2.1.10
- vue-template-compiler@2.2.6

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.

    at Object.<anonymous> (/home/frankdugan3/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/vue-template-compiler/index.js:8:9)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/frankdugan3/.vscode/extensions/octref.vetur-0.6.1/client/server/modes/typescriptMode.js:5:31)
    at Module._compile (module.js:556:32)
[Error - 9:12:49 AM] Connection to server got closed. Server will not be restarted.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 23 (16 by maintainers)

Commits related to this issue

Most upvoted comments

Sounds good. From vetur’s perspective:

  • If vue-template-compiler is present in project workspace, use it
  • Otherwise use our modified vue-template-compiler without the version match check

@sandersn vue-template-compiler’s index.js:

try {
  var vueVersion = require('vue').version
} catch (e) {}

var packageName = require('./package.json').name
var packageVersion = require('./package.json').version
if (vueVersion && vueVersion !== packageVersion) {
  throw new Error(
    '\n\nVue packages version mismatch:\n\n' +
    '- vue@' + vueVersion + '\n' +
    '- ' + packageName + '@' + packageVersion + '\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'
  )
}

module.exports = require('./build')

Think a better way is to remove this check and include vue-template-compiler’s code directly (or use a fork of it).

I feel it’s not worth it to add vue to just circumvent this error checking.