Skip to content
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 cannot resolve Nuxt Auto Imports in a new/renamed file #4167

Closed
kingychiu opened this issue Mar 28, 2024 · 3 comments
Closed

VSCode cannot resolve Nuxt Auto Imports in a new/renamed file #4167

kingychiu opened this issue Mar 28, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@kingychiu
Copy link

kingychiu commented Mar 28, 2024

In my current vscode setup, Nuxt and vue typescript is working fine. But when I rename or create a file, the type and resolution wont work on that new file only. Any ideas?

Project/Folder Setup, it is under a workspace:

/app-backend
/app-frontend
/app-frontend/tsconfig.json # This refs /app-frontend/.nuxt/tsconfig.json

I found that in the existing file, tsconfig is found:
Screenshot 2024-03-28 at 12 10 11 PM

But in a new file, no tsconfig is found:
Screenshot 2024-03-28 at 12 10 33 PM

For example, let's say I have a composable named useABC
VSCode can auto-suggest this when I type useAB only on an existing file.

AutoImport is working on an existing file:
Screenshot 2024-03-28 at 11 49 55 AM

After renaming, the resolution becomes different:
Screenshot 2024-03-28 at 11 50 54 AM

After restarting the entire VSCode, it will work again. Since now the vue restart command is removed (#4164), only restarting VSCode can resolve the issue.

@kingychiu kingychiu changed the title VSCode cannot resolve Nuxt Auto Imports in a new/renamed file. VSCode cannot resolve Nuxt Auto Imports in a new/renamed file in a nested/mono repo Mar 28, 2024
@kingychiu kingychiu changed the title VSCode cannot resolve Nuxt Auto Imports in a new/renamed file in a nested/mono repo VSCode cannot resolve Nuxt Auto Imports in a new/renamed file Mar 28, 2024
@davidmatter
Copy link
Collaborator

You can execute the "Reload Window" command. No need to restart VSCode. I have the same problem in a conventional Vue3 project, without nuxt, in 2.0.7.

johnsoncodehk added a commit that referenced this issue Mar 28, 2024
@johnsoncodehk johnsoncodehk added the bug Something isn't working label Mar 28, 2024
@johnsoncodehk
Copy link
Member

This problem should be fixed in the master branch, here are the relevant commits:

We need to wait for VSCode 1.88 to be released before we can update the extension. You can use 1.8.27 for now.

@johnsoncodehk
Copy link
Member

The restart command was re-add by #4174.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants