Next.js Discord

Discord Forum

Nextjs app directory 404

Unanswered
Polar bear posted this in #help-forum
Open in Discord
Polar bearOP
Hi! My team is looking to do an incremental page to app router migration. However, just creating an app directory breaks our page/404. Is there a config where we can tell app directory to not do this while we are setting up files?

8 Replies

Wandering Albatross
Have you check the page about migrate in Next Docs? https://nextjs.org/docs/app/guides/migrating/app-router-migration#migrating-from-pages-to-app

According to the doc, the App and Page folders can work together while the migration is being performed.
Polar bearOP
Yeah but I am running into the app router 404 not found page locally when I still have my page router 404 file
Tibetan Spaniel
maybe share your folder tree
Polar bearOP
looks like this is a common issue based on https://github.com/vercel/next.js/issues/58945
I can definitely "copy" the 404 page, just trying to figure out why it does this for local dev and if there is a way to change this behavior so that devs on my team are not confused by the difference in local vs prod
Yellowstripe scad
Not sure if this is or not intended behaviour, but from the sound of it, you haven't completed the migration to the App router completly? You shouldn't have a pages router if the app folder exists as per the issue you sent.
Polar bearOP
I have not. I have 100~ pages and am planning to migrate them incrementally but wanted to at least setup the app/layout file for the first page and etc.