Open douglasg14b opened 1 week ago
This seems similar to: https://github.com/vuejs/language-tools/issues/3947
Also noticing that this now fails in build as well, so it's not just an issue with the language tools? Something different with a Vue update?
Looks like a patch
versionof vue requires vue-tsc
to upgrade to ^2.0.22
.
However, after upgrading builds no longer work with vite:
error when starting dev server:
Error: Cannot find module 'vue-tsc/out/index'
After upgrading vite
and vite-plugin-checker
:
node:internal/event_target:1088
process.nextTick(() => { throw err; });
^
TypeError [Error]: Cannot read properties of undefined (reading 'useCaseSensitiveFileNames')
at Object.proxyCreateProgram (C:\Users\[snip]\Documents\01 Programming\02 Contracts\[snip]-app\node_modules\.pnpm\@volar+typescript@2.4.1\node_modules\@volar\typescript\lib\node\proxyCreateProgram.js:33:68)
at C:\Users\[snip]\Documents\01 Programming\02 Contracts\[snip]-app\node_modules\.pnpm\vite-plugin-checker@0.7.2_eslint@8.56.0_typescript@5.4.5_vite@5.4.2_vue-tsc@2.1.4\node_modules\vite-plugin-checker\dist\cjs\checkers\vueTsc\typescript-vue-tsc\lib\typescript.js:120483:225
at Object.<anonymous> (C:\Users\[snip]\Documents\01 Programming\02 Contracts\[snip]-app\node_modules\.pnpm\vite-plugin-checker@0.7.2_eslint@8.56.0_typescript@5.4.5_vite@5.4.2_vue-tsc@2.1.4\node_modules\vite-plugin-checker\dist\cjs\checkers\vueTsc\typescript-vue-tsc\lib\typescript.js:190858:3)
After finding this random comment that states that vue-tsc
may ahve hidden TS min-verison requirements, I upgraded TS to v5.5.x
. WHich resolved the above, and generated new errors:
node:internal/event_target:1088
process.nextTick(() => { throw err; });
^
TypeError [Error]: pluginContext.vueCompilerOptions.plugins is not iterable
at createPlugins (C:\Users\[snip]\Documents\01 Programming\02 Contracts\[snip]-app\node_modules\.pnpm\@vue+language-core@2.1.4_typescript@5.5.4\node_modules\@vue\language-core\lib\plugins.js:48:45)
at Object.createVueLanguagePlugin (C:\Users\[snip]\Documents\01 Programming\02 Contracts\[snip]-app\node_modules\.pnpm\@vue+language-core@2.1.4_typescript@5.5.4\node_modules\@vue\language-core\lib\languagePlugin.js:52:49)
After finding yet another comment (Thank god these repos don't drive people to information black holes like discord) that advised pinning vue-tsc
to 2.0.29
I can now build again finally.
Unfortunately after this whole depressing saga, global properties STILL fail to compile. So it's still skuffed after updating apparently as close to latest as possible.
Also apparently various other things are broken as well like like typings for things like defineEmits
and defineProps
?
Looks like this is also skuffed:
Alright, after adding "types": ["./src/types.d.ts"]
to my tsconfig
the issues with defineEMits
, vue
module...etc have vanished. (How in the world has this been fine for nearly a year up till now?). However, the issue with ComponentCustomProperties
still persists 😥
Related threads:
This also seems to be a problem for vue-router
as well as $route
is also not available in templates.
Due to our past use of @vue/runtime-core
to augment Vue, this caused breaks in augmentation of vue
. We are now gradually standardizing the use of vue
for augmentation across other libraries. If this issue still occurs in your dependencies, you can temporarily switch to vue
and make a PR to the upstream repository.
Related? https://github.com/vuejs/language-tools/issues/4755
@KazariEX Sorry, I don't understand. This did not appear to be a problem in earlier versions, however it is a problem now. Due to some combination of dependencies & breaking changes this has regressed. If I knew how to fix it, I would have 😅
Can you clarify?
Anyway, I suggest that you first bump all your dependencies to the latest version, and try searching for declare module '@vue/runtime-core'
in the node_modules directory. If you find any libraries using it to augment Vue, modify it to declare module 'vue'
.
If the issue persists after making these changes, I believe we need a minimal reproduction to pinpoint the root cause of the problem.
I have also encountered this issue on the latest version of nuxt. Only in the template, the vscode plugin cannot correctly recognize the automatically exported functions. I don't know where the source of the problem is, and whether it is due to the vscode plugin
Here is a minimal reproduction to highlight the error coming in nuxt 3. @KazariEX
https://stackblitz.com/edit/github-vw7ht4?file=nuxt.config.ts
So, for others here the guidance appears to be this:
declare module '@vue/runtime-core'
will absolutely brick your applications type resolution for ComponentCustomProperties
To find these dependencies and fix them:
If any of these dependencies don't have updates, or are abandoned, then based on what I've learned here and in debugging your are screwed, and so is your CI/CD pipeline. You would need to do global find & replace before any builds, and locally.
Edit: Or make PRs to the relevant projects, assuming they are active.
If any of these dependencies don't have updates, or are abandoned, then based on what I've learned here and in debugging your are screwed, and so is your CI/CD pipeline. You would need to do global find & replace before any builds, and locally.
Or make PRs to the libraries you use. While waiting for it to get merged you can point towards your own fork in package.json.
Vue - Official extension or vue-tsc version
v2.1.4
VSCode version
1.92.2
Vue version
3.4.38
TypeScript version
5.4.5
System Info
No response
package.json dependencies
Steps to reproduce
Upgrade extension to v2.1.4
What is expected?
That global augmented propeties work
What is actually happening?
They don't.
Link to minimal reproduction
No response
Any additional comments?