#Intercepting stops working in prod

1 messages · Page 1 of 1 (latest)

deft sentinel
#

I have a Intercepting path. In Production vercel it works for a couple of hours in ater deployment, but then pressing the link for intercepting starts full refreshing

velvet peakBOT
#

Hi @deft sentinel. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

There are multiple reports of intercepting routes in Next.js working as expected in development or shortly after deployment, but then failing in production—often resulting in a full page navigation instead of the expected modal or intercepted behavior. This issue is especially prevalent when deploying to Vercel.

From the knowledge sources:

  • Several users have observed that intercepting routes (modals, etc.) work locally and immediately after deployment, but after some time, the interception stops working and triggers a full page refresh or navigation instead. This has been reported for both static and dynamic routes, and sometimes is related to caching or static generation strategies (Intercepting & Parallel route on vercel is broken, Intercepting routes not working in production).
  • One user noted that marking the server component with export const dynamic = 'force-dynamic'; can serve as a workaround, forcing the route to be treated as dynamic and potentially avoiding issues with static caching interfering with interception (v15 intercepting routes not working).
  • Another user pointed out that using generateStaticParams only solves the problem for pages generated at build time; if a page is not pre-generated, interception may fall back to a hard navigation (Dynamic intercepting parallel route is server side rendered).
  • There are also reports that CDN or cache invalidation may play a role, where after a deployment, the cache is fresh, but as it becomes stale or is invalidated, interception breaks and a hard reload occurs (Dynamic intercepting parallel route is server side rendered).
#

Summary:
This is a known issue with intercepting routes in production, especially on Vercel, where interception may stop working after some time post-deployment and revert to full page navigation. Workarounds include forcing dynamic rendering with export const dynamic = 'force-dynamic';, but the underlying cause may relate to static generation, caching, or CDN behavior. If you are affected, consider this workaround and monitor related GitHub issues for updates, as this is an area of active investigation and improvement by the Next.js team.

If you need a workaround, try adding the following to your intercepted route's server component:

export const dynamic = 'force-dynamic';

This may help prevent the route from being statically cached and keep interception working as expected in production environments like Vercel.

For more details and ongoing discussion, see the following issues:


Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: