New project - Your project has pages but the `<NuxtPage />` component has not been used.
I've created a project using the nuxt new command, installed with nuxt/ui and nuxt/image and I am getting this error when navigating to any page

3 Replies
Hi @Lucas Dias. 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 "Your project has pages but the
Nuxt uses file-based routing, and the presence of a
<NuxtPage />
component has not been used" means that you have a pages/
directory in your Nuxt project, but you haven't included the <NuxtPage />
component in your app.vue
file. The <NuxtPage />
component is required to render the pages defined in your pages/
directory. Without it, Nuxt cannot display your routes.
How to fix:
Open your app.vue
file and ensure it includes <NuxtPage />
. For example:
If you are using Nuxt UI, you should wrap your app with <UApp>
, as shown above, and place <NuxtPage />
inside it. This setup is required for Nuxt UI components to work properly and for your pages to be rendered [Nuxt UI Installation Guide].
Why this happens:Nuxt uses file-based routing, and the presence of a
pages/
directory triggers the routing system. The <NuxtPage />
component is what actually displays the current page component based on the route. If you omit it from app.vue
, Nuxt cannot render your pages and will show this error [Nuxt Docs: app.vue usage].
Summary of steps:
1. Open app.vue
.
2. Add <NuxtPage />
inside the template, optionally wrapped with <UApp>
if using Nuxt UI.
This should resolve the error and allow your pages to render correctly.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@444649908415234069> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
This is my setup
app\app.vue
app\layouts\default.vue
app\pages\index.vue
as suspected... cleaning .nuxt, node_modules and using npm instead of bun solved my problem