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

v2.0.11 and later, In typescript files, importing .vue files yields "Cannot find module" error #4288

Closed
michaeldaw opened this issue Apr 22, 2024 · 5 comments
Labels
question Further information is requested

Comments

@michaeldaw
Copy link

michaeldaw commented Apr 22, 2024

In v2.0.11 and later, any typescript file that attempts to import a .vue file results in the error message in the following screenshot:
Cannot find module <module> or it's corresponding type declarations

The most obvious case of this happening is in the main.ts when attempting to import App.vue in a default project. However, it happens in any .ts file.

Reverting back to 2.0.10 fixes the issue. The error starts occurring in 2.0.11.
image

@michaeldaw michaeldaw changed the title v2.0.11 and later, In typescript files, import statements cannot find any .vue files v2.0.11 and later, In typescript files, importing .vue files yields "Cannot find module" error Apr 22, 2024
@johnsoncodehk
Copy link
Member

johnsoncodehk commented Apr 22, 2024

When opening a Vue project file in a new VSCode window, do you see a message similar to the following?
image

@michaeldaw
Copy link
Author

No, not that I can see.

@johnsoncodehk
Copy link
Member

Can you share a screenshot from here?
image

@michaeldaw
Copy link
Author

It looks like the problem with the "Hybrid Mode" setting. It was set to False. When I set it to true, the errors were no longer occurring.
I'm going to close the issue. Thanks for taking the time to look into it. I'll keep this setting in mind if I see errors like this in the future.

@johnsoncodehk
Copy link
Member

You can also revert it to the default "auto" to avoid compatibility issues. (See #4206)

@johnsoncodehk johnsoncodehk added the question Further information is requested label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants