Next.js Discord

Discord Forum

Route interceptor not working with Next15

Answered
Da_v_id posted this in #help-forum
Open in Discord
Avatar
Hi,
I have updated my project to nextjs 15 and my route inteceptor stopped working.
It still works with pnpm dev --turbo but it doesn't work after I build the project. I basically followed this guide https://nextjs.org/docs/app/building-your-application/routing/intercepting-routes to show the route as a modal/dialog when I click a button, but still open it as a fullpage when i navigate to the URL. So the form renders properly when i navigate to the route, but it shows this error screen when i click on the button, and there is nothing in the logs.
Image
Answered by Da_v_id
Not sure why it was working on Nextjs 14, but to fix it on Nextjs 15 i had to add export const dynamic = "force-dynamic"; ot top of my @modal/(.)create/page.tsx file
View full answer

1 Reply

Avatar
Not sure why it was working on Nextjs 14, but to fix it on Nextjs 15 i had to add export const dynamic = "force-dynamic"; ot top of my @modal/(.)create/page.tsx file
Answer