Pages not working with app.vue
The issue is this:
When i have a /app/app.vue - with even the most minimal template possible:
It fails to load any page I request, such as "index.vue", "coolpage.vue"
The page is basically app.vue, but without the <NuxtPage />...
If i add some content to app.vue - it displays the content
The console displays this warning when i try to load the page or any pages:
WARN Create a Vue component in the pages/ directory to enable <NuxtPage>

2 Replies
Hi @DefNotMC. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
The issue you're experiencing—where
In Nuxt 4, the
Your
If your
Your issue is caused by the
<NuxtPage />
in /app/app.vue
does not render any pages from your pages/
directory and you see the warning:
—suggests that Nuxt is not detecting your pages/
directory or its contents.
Key things to check based on the official documentation and related issues:
1. Directory Structure in Nuxt 4:In Nuxt 4, the
pages/
directory should be placed inside the /app
directory, i.e., /app/pages
. If you have your pages/
directory at the project root (as in Nuxt 2 or early Nuxt 3), Nuxt 4 will not recognize it, and <NuxtPage />
will not work as expected.In Nuxt 4 your2. Minimal Working Example:/pages
folder should be placed within the/app
folder, i.e./app/pages
Github Issue #32761
Your
/app/app.vue
should look like this:
And your pages should be in /app/pages/index.vue
, /app/pages/coolpage.vue
, etc.When you have a3. If the Directory is Misplaced:pages/
directory, you need to use the<NuxtPage>
component to display the current page Docs > Directory-structure > App > app.vue
If your
pages/
directory is not inside /app
, Nuxt will not include the router and will show the warning you described.Nuxt provides file-based routing... this directory is optional, meaning thatHow to fix: - Move yourvue-router
won't be included if you only useapp.vue
Docs > Directory-structure > App > pages
pages/
directory into the /app
directory so the structure is:
- Restart your development server after making this change.
Summary:Your issue is caused by the
pages/
directory not being in the correct location for Nuxt 4. Move it to /app/pages
and <NuxtPage />
will work as expected.
If you have already done this and still see the warning, please double-check the directory names and restart your dev server. If the problem persists, there may be another configuration issue, but the knowledge sources do not provide further troubleshooting steps beyond this directory structure requirement.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@969929575595376660> Kapa.ai is still learning and improving, please let me know how I did by reacting below.