-
-
Notifications
You must be signed in to change notification settings - Fork 489
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Vue - Official extension or vue-tsc version
vue-tsc 3.0.0
VSCode version
StackBlitz
Vue version
3.5.22
TypeScript version
5.9.3
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 20.19.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
package.json dependencies
{
"dependencies": {
"pinia": "^3.0.3",
"typescript": "^5.9.3",
"vue": "^3.5.22",
"vue-router": "^4.5.1",
"vue-tsc": "^3.0.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^6.0.1",
"vite": "^7.1.9"
}
}
Steps to reproduce
- Open https://stackblitz.com/edit/vue-tsc-no-types-bug?file=src%2FApp.vue&terminal=dev
- Run
npm test
in terminal - Observe
vue-tsc
result
What is expected?
Typechecking should only report missing type for this.bar
.
this.foo
is defined as computed property on current component, and this.$router
and this.$pinia
come from external package types.
What is actually happening?
Typechecking reports missing type for properties that should exist on current component instance.
Link to minimal reproduction
https://stackblitz.com/edit/vue-tsc-no-types-bug?file=src%2FApp.vue&terminal=dev
Any additional comments?
vue-router and pinia both have type definitions which should be used for Options API components
You can check them at the bottom of each file:
- https://cdn.jsdelivr.net/npm/vue-router@4.5.1/dist/vue-router.d.ts
- https://cdn.jsdelivr.net/npm/pinia@3.0.3/dist/pinia.d.ts
It seems like those types are not picked by vue-tsc
and also by Vue language server.
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested