-
-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VSCode complains about *.vue imports across project boundaries when using project references #4711
Comments
I haven't checked the repro case yet, but I think it's likely related to microsoft/TypeScript#57632. |
Isn't this related to #4632? |
@johnsoncodehk I'm not sure. Isn't the given issue about situations when there are tsconfigs with overlapping In any case, in the minimal reproduction I linked 1) there are no overlapping |
I'm not sure it is. In the ticket you linked, OP's example code uses separate pnpm workspaces for their folders
so as to make it available in their app's node_modules. To me this sounds different from the situation in my code example: I have a single workspace and a single |
While the changes in v2.1.2 have improved the type checks & code suggestions, VSCode still complains about the imports themselves. I have created a new ticket -> #4750 |
Vue - Official extension or vue-tsc version
Vue extension 2.0.28, vue-tsc 2.0.29
VSCode version
1.90.2 (VSCodium 1.90.2.24171)
Vue version
3.4.34
TypeScript version
5.4.5
System Info
No response
Steps to reproduce
Use
npm create vue
to set up a new Vue project. Adjusttsconfig.(app|vitest).json
in such a way that theirincludes
don't overlap (tsconfig.app.json includes only production code,tsconfig.vitest.json
only test code) and so thattsconfig.vitest.json
liststsconfig.app.json
in itsreferences
.What is expected?
VSCode is able to resolve the imports correctly, recognize the type error in the file, and also provide code suggestions when using the imported type & component.
What is actually happening?
VSCode / the Vue extension complains about imports from
HelloWorld.vue
inHelloWorld.spec.ts
and doesn't recognize a type error that I added to that file. It also doesn't provide code suggestions when using the imported type & component.See also the screenshots I posted here.
Meanwhile, vue-tsc on the command line works fine.
Link to minimal reproduction
https://github.com/codethief/tsconfig-playground/tree/3df37ce7f2e1b90c4e7d7b948b494232b9fbfc3d/2024-07-25-vue-setup-with-project-references
Any additional comments?
This is the issue we started discussing in #3526 (comment), just as a separate ticket.
I hope you'll allow me to mention some more anecdotal evidence, beyond the minimal reproduction:
My coworker also saw the same issue with
*.vue
imports in test files in our frontend project in IntelliJ 2024.2.0.2 (with Vue.js plugin 242.20224.419). Meanwhile, in the minimal reproduction I linked to above his IntelliJ does not complain. Interestingly, my coworker noticed that in the minimal reproduction IntelliJ's bottom bar reports the Vue LSP to be active, whereas in the*.test.ts
files in our real-life project both TS and Vue are active. I don't know what that means / implies but it reminded me of @vidal7's comment here.I should mention that this issue does not seem to be restricted to
*.ts
files. In our project we have a few non-production*.vue
files (Histoire*.story.vue
files) that import production Vue components and, there, VSCode reports a broken import, too.The text was updated successfully, but these errors were encountered: