Reproduction
Coming next week
Steps to reproduce the bug
After upgrading to vue-router 5.0.1 and following the migration guide (https://router.vuejs.org/guide/migration/v4-to-v5.html) I get this error:
[niko@arch-zfs ympact-web-ui-review]$ yarn workspace visit run type-check
[Vue] Failed to create plugin TypeError: Cannot read properties of undefined (reading 'rootDir')
at plugin (/home/niko/devel/ympact-web-ui-review/node_modules/vue-router/dist/volar/sfc-typed-router.cjs:37:26)
at /home/niko/devel/ympact-web-ui-review/node_modules/@vue/language-core/lib/plugins.js:59:30
at Array.flatMap (<anonymous>)
at createPlugins (/home/niko/devel/ympact-web-ui-review/node_modules/@vue/language-core/lib/plugins.js:56:10)
at Object.createVueLanguagePlugin (/home/niko/devel/ympact-web-ui-review/node_modules/@vue/language-core/lib/languagePlugin.js:69:49)
at /home/niko/devel/ympact-web-ui-review/node_modules/vue-tsc/index.js:52:44
at Object.apply (/home/niko/devel/ympact-web-ui-review/node_modules/@volar/typescript/lib/node/proxyCreateProgram.js:51:33)
at getBuilderCreationParameters (/home/niko/devel/ympact-web-ui-review/node_modules/typescript/lib/tsc.js:126800:18)
at createEmitAndSemanticDiagnosticsBuilderProgram (/home/niko/devel/ympact-web-ui-review/node_modules/typescript/lib/tsc.js:127455:5)
at host.createProgram (/home/niko/devel/ympact-web-ui-review/node_modules/typescript/lib/tsc.js:132477:12)
The following diff is enough to fix the problem:
diff --git a/packages/visit/tsconfig.app.json b/packages/visit/tsconfig.app.json
index 10a18da53..fb0a5a197 100644
--- a/packages/visit/tsconfig.app.json
+++ b/packages/visit/tsconfig.app.json
@@ -17,8 +17,15 @@
},
"vueCompilerOptions": {
"plugins": [
- "vue-router/volar/sfc-route-blocks",
- "vue-router/volar/sfc-typed-router"
+ {
+ "name": "vue-router/volar/sfc-route-blocks"
+ },
+ {
+ "name": "vue-router/volar/sfc-typed-router",
+ "options": {
+ "rootDir": "."
+ }
+ }
]
}
}
Expected behavior
Should work without options
Actual behavior
Doesn't work without options
Additional information
The migration guide (https://router.vuejs.org/guide/migration/v4-to-v5.html) doesn't mention having to add options.
Reproduction
Coming next week
Steps to reproduce the bug
After upgrading to vue-router 5.0.1 and following the migration guide (https://router.vuejs.org/guide/migration/v4-to-v5.html) I get this error:
The following diff is enough to fix the problem:
Expected behavior
Should work without
optionsActual behavior
Doesn't work without
optionsAdditional information
The migration guide (https://router.vuejs.org/guide/migration/v4-to-v5.html) doesn't mention having to add options.