{"record":{"id":"79f8306400de46b2","repo":"vuejs/vue","slug":"n-nvue-packages-version-mismatch-n-n-vue-vuev-79f830","errorCode":null,"errorMessage":"\\n\\nVue packages version mismatch:\\n\\n- vue@${vueVersion} (${vuePath})\\n- ${packageName}@${packageVersion} (${packagePath})\\n\\nThis may cause things to work incorrectly. Make sure to use the same version for both.\\nIf you are using vue-loader@>=10.0, simply update vue-template-compiler.\\nIf you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump ${packageName} to the latest.\\n","messagePattern":"\\\\n\\\\nVue packages version mismatch:\\\\n\\\\n- vue@(.+?) \\((.+?)\\)\\\\n- (.+?)@(.+?) \\((.+?)\\)\\\\n\\\\nThis may cause things to work incorrectly\\. Make sure to use the same version for both\\.\\\\nIf you are using vue-loader@>=10\\.0, simply update vue-template-compiler\\.\\\\nIf you are using vue-loader@<10\\.0 or vueify, re-installing vue-loader/vueify should bump (.+?) to the latest\\.\\\\n","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/template-compiler/index.js","lineNumber":10,"sourceCode":"try {\n  var vueVersion = require('vue').version\n} catch (e) {}\n\nvar packageName = require('./package.json').name\nvar packageVersion = require('./package.json').version\nif (vueVersion && vueVersion !== packageVersion) {\n  var vuePath = require.resolve('vue')\n  var packagePath = require.resolve('./package.json')\n  throw new Error(\n    '\\n\\nVue packages version mismatch:\\n\\n' +\n      '- vue@' +\n      vueVersion +\n      ' (' +\n      vuePath +\n      ')\\n' +\n      '- ' +\n      packageName +\n      '@' +\n      packageVersion +\n      ' (' +\n      packagePath +\n      ')\\n\\n' +\n      'This may cause things to work incorrectly. Make sure to use the same version for both.\\n' +\n      'If you are using vue-loader@>=10.0, simply update vue-template-compiler.\\n' +\n      'If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump ' +\n      packageName +\n      ' to the latest.\\n'","sourceCodeStart":1,"sourceCodeEnd":28,"githubUrl":"https://github.com/vuejs/vue/blob/9e88707940088cb1f4cd7dd210c9168a50dc347c/packages/template-compiler/index.js#L1-L28","documentation":"Thrown at module-load time by vue-template-compiler's index.js when require('vue').version differs from vue-template-compiler's package.json version. Unlike the server-renderer variant (error 3), this message includes the resolved file paths for both packages and specific remediation advice keyed to vue-loader version. vue-template-compiler must match the Vue runtime version exactly because the compiler output is version-specific.","triggerScenarios":"Requiring vue-template-compiler in a project where node_modules/vue is a different version. The version strings are compared as exact matches, so even 2.7.14 vs 2.7.16 fails. The require.resolve paths are included so the user can see which physical files are mismatched.","commonSituations":"vue was upgraded but vue-template-compiler was left behind (very common — they are separate packages). npm dedupe installed a nested mismatched copy. A monorepo hoisted different versions. vue-loader pinned vue-template-compiler to an old version. Lockfile drift.","solutions":["Align versions exactly: npm install vue@2.7.16 vue-template-compiler@2.7.16 (must match character-for-character).","Run `npm ls vue vue-template-compiler` to find all installed copies and dedupe.","If using vue-loader >= 10, the message says to update vue-template-compiler to match vue.","If using vue-loader < 10 or vueify, reinstall vue-loader to bump vue-template-compiler transitively.","Delete node_modules and lockfile and reinstall to clear dedupe drift."],"exampleFix":"// before\n// package.json: \"vue\": \"2.7.16\", \"vue-template-compiler\": \"2.6.14\"\n\n// after — exact match\n// package.json: \"vue\": \"2.7.16\", \"vue-template-compiler\": \"2.7.16\"\n// run: npm install","handlingStrategy":"validation","validationCode":"const vueVersion = require('vue/package.json').version\nconst compilerVersion = require('vue-template-compiler/package.json').version\n\nif (vueVersion !== compilerVersion) {\n  throw new Error(\n    `vue@${vueVersion} and vue-template-compiler@${compilerVersion} must match exactly. ` +\n    `Run: npm install vue-template-compiler@${vueVersion}`\n  )\n}\nrequire('vue-template-compiler')","typeGuard":"function versionsMatch(a: string, b: string): boolean {\n  return a === b\n}","tryCatchPattern":"// Like error 3, this throws at require() time. Pre-validate before requiring:\nconst pkg = name => require(`${name}/package.json`).version\nif (pkg('vue') !== pkg('vue-template-compiler')) {\n  throw new Error(`Run: npm install vue-template-compiler@${pkg('vue')}`)\n}\nrequire('vue-template-compiler')","preventionTips":["Pin vue and vue-template-compiler to the exact same version (drop caret/tilde).","Add a postinstall or prebuild script that asserts version equality and exits non-zero on mismatch.","When upgrading vue, always upgrade vue-template-compiler in the same commit.","In monorepos, use npm/yarn overrides to force alignment across workspaces.","Run `npm ls vue vue-template-compiler` in CI to detect nested mismatched copies."],"tags":["vue","version-mismatch","template-compiler","vue-loader","dependency"],"analyzedSha":"9e88707940088cb1f4cd7dd210c9168a50dc347c","analyzedAt":"2026-08-11T22:22:01.295Z","schemaVersion":2},"datasetVersion":"2026-08-12T05:08:24.936Z"}