#Unable to view the pages/index.vue
1 messages · Page 1 of 1 (latest)
Hi @true nebula. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
If you have created a new Nuxt project and added a pages/index.vue file, but are unable to view the home page even after adding <NuxtPage /> in app.vue, here are some things to check based on the official documentation:
-
Correct Directory Structure
Make sure yourpages/index.vuefile is in the correct location:your-project/ ├─ pages/ │ └─ index.vue └─ app.vue -
Single Root Element in Page
Each page component (likepages/index.vue) must have a single root element. For example:<template> <div> <h1>Home Page</h1> </div> </template>If you have multiple root elements or an HTML comment as the first element, the page may not render correctly during client-side navigation see details.
-
app.vue Setup
Yourapp.vueshould include the<NuxtPage />component to render the current page:<template> <NuxtPage /> </template>Or, if you want to add a layout:
<template> <header>Header</header> <NuxtPage /> <footer>Footer</footer> </template> -
Development Server
Make sure your development server is running. Use:npm run devThen visit [http://localhost:3000](http://localhost:3000) in your browser see installation guide.
-
No HTML Comments as Root
Do not start your page template with an HTML comment, as this will break client-side navigation see example.
If you have followed all these steps and still cannot see your home page, please double-check for typos or errors in your file structure and code. If the problem persists, please provide the content of your app.vue and pages/index.vue files for further help.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@true nebula Kapa.ai is still learning and improving, please let me know how I did by reacting below.
That didn't solve my issue
Pages folder should be inside the app folder if you’re on Nuxt 4
Ohhh Ok thank you, lemme try that
OMG, it worked, thanks. I didn't see it in the docs