Next.js Discord

Discord Forum

Mixing App routes and pages routes - prefetching each other

Unanswered
Alligator mississippiensis posted this in #help-forum
Open in Discord
Alligator mississippiensisOP
I've take over an old project that is mid Pages -> App router migration but whilst it's stuck in this phase for a while - I've noticed that pages routes try and prefetch app routes (there is a json file fetched in network panel) and Sentry is littered with Failed to lookup route: errors because the app ones don't exist in the manifest.

Similarly my App router seems to prefetch Pages routes with ?rsc query params. The [docs](https://nextjs.org/docs/app/guides/migrating/app-router-migration#using-app-router-together-with-pages-router) suggest:

When navigating between routes served by the different Next.js routers, there will be a hard navigation. Automatic link prefetching with next/link will not prefetch across routers.

Whilst it does a hare reload - which is fine - it continues to prefetch and error in various ways.

0 Replies