Vue : Cannot find name
Hello,
I've been getting this anoying errors in my fresh project in nuxt 3.
I've copied almost everything like in my previus project where this does not happen with imported types.
There are diferences in vue and nuxt versions.
I've included screenshots of my package jsons.
Project with 3.8.0 nuxt version is project where this doesn't happen.




2 Replies
Hi @Cager. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided in the knowledge sources, it appears that you're experiencing TypeScript-related issues in your Nuxt 3 project. This is a common problem that can occur due to various reasons, including version incompatibilities or configuration issues. Here are some potential solutions and insights:
1. Version Compatibility:
The issue might be related to the version of Nuxt you're using. As mentioned in this GitHub issue, there have been compatibility issues with certain versions of
vue-tsc
. Make sure you're using compatible versions of Nuxt and its dependencies.
2. TypeScript Configuration:
Ensure that your TypeScript configuration is correct. As mentioned in the Nuxt documentation, you can improve clarity within your IDE between auto-imports from 'nitro' and 'vue' by adding a ~/server/tsconfig.json
file with specific content.
3. IDE-specific Issues:
According to a Stack Overflow post, there's a known bug in JetBrains IDEs (PhpStorm, WebStorm) related to custom global properties added by augmenting Vue. If you're using one of these IDEs, try opening the same project in VSCode to see if the issue persists.
4. Clearing Cache and Reinstalling Dependencies:
Sometimes, clearing the Nuxt cache and reinstalling dependencies can resolve TypeScript-related issues. Try deleting the .nuxt
folder and node_modules
, then reinstall your dependencies.
5. Check for Conflicting Imports:
As mentioned in this GitHub issue, there can be conflicts between Nuxt and Nitro imports with the same name. Ensure that your imports are correctly specified and don't conflict.
If none of these solutions work, you might want to create a minimal reproduction of your issue and share it on the Nuxt GitHub repository for more specific assistance.
Remember to always keep your Nuxt and its dependencies up to date, as many issues are resolved in newer versions.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@337641109914386445> Kapa.ai is still learning and improving, please let me know how I did by reacting below.