Problem with show pages in menu
Friends, I have a problem loading views in my menu and front end. When I click on the menu it doesn't show me the views and when I check the terminal I have some problems that I can't understand why... I admit that it's been a long time since I started a new project with NuxtJS, maybe I missed something or I'm overlooking something...
It shows me the error I share in the attached image.
and this is my tsconfig.json
Can't understand the problem

3 Replies
Hi @TranceCode. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
The error message you’re seeing—“Failed to write the global types file. Make sure that: 1. 'node_modules' directory exists. 2. 'vue' is installed as a direct dependency.”—is related to your development environment, not directly to Nuxt’s routing or menu logic.
Based on the knowledge sources, this issue is commonly encountered when using the Vue VSCode extension (Volar) and is not specific to Nuxt itself. Here’s what you should check and try:
1. Ensure "vue" is a direct dependency
Make sure you have installed
If you recently cloned the project or deleted
Sometimes, the error persists until you restart the language servers. In VSCode, open the command palette and run: or simply reload the VSCode window. 4. About
You have set
You already have
This error is not related to Nuxt’s routing or menu system, but rather to your editor’s type support setup. Once resolved, your menu and page navigation should work as expected, provided your Nuxt pages and routes are set up correctly. Summary:
Install
Make sure you have installed
vue
in your project, not just as a transitive dependency. Run:
or
as appropriate for your package manager. This step has resolved the issue for other users with the same error message Github Issue: Error when opening .vue files with Vue VS Code extension.
2. Check that "node_modules" existsIf you recently cloned the project or deleted
node_modules
, run:
or
to ensure all dependencies are present.
3. Restart VSCode’s TypeScript and Vue serversSometimes, the error persists until you restart the language servers. In VSCode, open the command palette and run: or simply reload the VSCode window. 4. About
vueCompilerOptions.globalTypesPath
You have set
"globalTypesPath": "./types/global.d.ts"
in your tsconfig.json
. Make sure this file exists. If you don’t need custom global types, you can remove this option to let Volar handle it automatically.
5. Exclude node_modulesYou already have
"exclude": ["node_modules", ...]
in your config, which is correct and recommended.
6. Not a Nuxt Routing/Menu IssueThis error is not related to Nuxt’s routing or menu system, but rather to your editor’s type support setup. Once resolved, your menu and page navigation should work as expected, provided your Nuxt pages and routes are set up correctly. Summary:
Install
vue
as a direct dependency, ensure node_modules
exists, and restart your editor’s language servers. This should resolve the error and restore proper type support and possibly fix issues with your menu not displaying pages, if those were caused by type errors interfering with development tools. For more details, see the discussion in this closed Nuxt issue.
If you continue to have issues with the menu not showing pages after fixing the above, check your Nuxt pages directory and routing setup. But the error message you posted is specifically about your development environment, not Nuxt’s runtime.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@351111658694770689> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
this is my package.json