Closed scandar closed 3 months ago
Seeing the same issue here. Reverted to 2.0.26 and all is fine now. We have a similar project structure with components in another package in a monorepo. We also have the vscode file watcher disabled.
Can't reproduce. Please provide a minimal example repo
Here you go (check in app/src/App.vue
):
https://github.com/arpadgabor/vue-volar-bug-repro
And here are a couple of screenshot with the behaviour in VSCode in v2.0.28 vs v2.0.26:
Workaround for now:
app/tsconfig.json
:
follow with interest
Workaround for now:
app/tsconfig.json
:
This solution is ineffective
Please try updating all dependencies to the latest version.
Confirmed, pnpm update -r
solves this
Update: Only until you reload the window. We need to look into this
@davidmatter it would be better to identify the exact dependency that I should update.
This issue is affecting external component libraries.
Here is an example of the use of the nuxt-mapbox
Nuxt module installed with version v2.0.28
:
It only happens with .vue
components using the script setup.
Example 1: This component from the @nuxt/content
module works correctly (the .d.ts
file is available in the dist):
https://github.com/nuxt/content/blob/main/docs/components/content/Example/ExampleTitle.vue
Example 2: This component from nuxt-mapbox
doesn't work (it does not have a .d.ts
file in the dist):
https://github.com/AlexLavoie42/Nuxt-Mapbox/blob/main/src/runtime/components/Map.vue
Both examples above work correctly with version
v2.0.26
installed on VSCode.
Script block is don't matter. If restart the server, it will degrade to any, too. Only at new files or renamed files could be correctly get the type.
For anyone else coming here who like me thought the ticket might be about project references (i.e. similar to https://github.com/vuejs/language-tools/issues/4711): OP's example code does involve project references but it uses separate pnpm workspaces for their folders /app
and /ui
(each with its own solution-style tsconfig.json
) and then they include the /ui
workspace in their /app/package.json
:
"dependencies": {
"ui":"workspace:*",
so as to make it available in their app's node_modules. So the issue seems to be not so much about project references (https://github.com/vuejs/language-tools/issues/4711) but more similar in nature to https://github.com/vuejs/language-tools/issues/4611 and https://github.com/vuejs/language-tools/issues/4607 (though of course maybe those issues are all the same under the hood – I have no idea).
Vue - Official extension or vue-tsc version
v2.0.26
VSCode version
Version: 1.91.1 (Universal)
Vue version
3.3.13
TypeScript version
5.4.5
System Info
Steps to reproduce
in a pnpm monorepo with this structure apps |_foo packages |_ui
packages/ui includes vue components, when a component is imported from
packages/ui
inapps/foo
vscode shows this error.reverting to a previous version doesn't show the error
What is expected?
The component should be resolved properly
What is actually happening?
Link to minimal reproduction
No response
Any additional comments?
No response