Can't I have a page.tsx inside a route group?
Answered
Silver carp posted this in #help-forum
Silver carpOP
I didn't find anything in the documentation about this
https://github.com/orgs/vercel/discussions/3580
https://github.com/orgs/vercel/discussions/3580
Answered by Plague
you need to either remove the
page.tsx inside the (app) folder or the one outside of it they are conflicting.13 Replies
Silver carpOP
How could I better structure the files to avoid this error?
Can you show the whole folder structure? From the screenshot it looks like you don't have an entry point for nvm
/ (your home page)idea-mangagement being highlighted threw me off, you do have an entry point which is the page.tsx you have in the screenshotSilver carpOP
Ah okay there is the issue, you have two page.tsx's at the same route segment level
(app) is purely organizational, it doesn't affect the URL path so the
page.tsx inside (app) is still your entry point / the one outside are conflicting with the ones inside or vice versa depending on the behavior you are looking foryou need to either remove the
page.tsx inside the (app) folder or the one outside of it they are conflicting.Answer
Silver carpOP
So should I delete src/page.tsx, keep src/layout.tsx and keep the layout within the groups, with each group not having page.tsx?
The layouts are fine
Only issue is the
page.tsx filesSilver carpOP
I see, I will fix it
Thanks!
No problem