Open ModyQyW opened 6 days ago
I think the deletion here caused this issue. The ts file I used below can solve some problems.
type A = import('@vue/runtime-core').GlobalComponents;
declare module 'vue' {
interface GlobalComponents extends A {}
}
I think the deletion here caused this issue. I can temporarily solve this problem by configuring it like this.
"vueCompilerOptions": { "lib": "@vue/runtime-core", },
Thank you for your help, but there are still some problems. I will use the following code as an example
<el-button type="success" size="a">Success</el-button>
type
to enter the type declaration filesize="a"
I entered is obviously wrong, and there is no red prompt@zzh948498
If you are using pnpm, you need to install @vue/runtime-core.
@vue/runtime-core
Sorry I didn't describe it clearly. The global type is indeed loaded successfully But some features are missing, as I described above
This is the result of my rollback to v2.0.21 :
If you are using pnpm, you need to install @vue/runtime-core.
Just want to provide a better solution i found, create a .npmrc
then add public-hoist-pattern[]=@vue/runtime-core
Note: If in mono repo, it will only work in the root level.
I think the deletion here caused this issue. The configuration I used below can solve some problems, but the props check failed.
"vueCompilerOptions": { "lib": "@vue/runtime-core", },
Unfortunately, the deletion is intentional since TS 5.5 introduced some internal changes that make the old approach to detect if a module/type exists no longer work in TS 5.5.
But some features are missing, as I described above
@zzh948498 I'm sorry I didn't conduct a complete investigation. I have updated the new solution, and it seems to work fine for me.
type A = import('@vue/runtime-core').GlobalComponents;
declare module 'vue' {
interface GlobalComponents extends A {}
}
Vue - Official extension or vue-tsc version
v2.0.22
VSCode version
v1.90.2
Vue version
v3.4.30
TypeScript version
v5.5.2
System Info
Steps to reproduce
Reload VSC window.
Check
src/pages/index/index.vue
and find out the types are lost.Link to minimal reproduction
/
Any additional comments?
I can confirm that v2.0.21 is fine, so that it may be caused by v2.0.22 https://github.com/vuejs/language-tools/pull/4492. If you guys can help me and point out how
@uni-helper/uni-app-types
should be tweaked, I'd appreciate it. Always thank you very much for the work you do! 🙏