Parallel Routes 404 When Used With CacheComponent #86558
-
|
All my parallel routes become 404 when combined it with cacheComponent in new Next 16+. More detail:
When I'm at
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
|
Hi @phuctran1203, were you able to find a solution? |
Beta Was this translation helpful? Give feedback.
-
|
Hi, I'm encountering the same error, currently my work around is turn that intercepted parralel route into a 'use client' file, then use the fetch function with 'use cache' in useEffect. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you all for the help! As I mentioned, I have been struggling with the issue of intercepting routes working together, particularly with the “cacheComponents” feature being enabled. In the back of my mind I knew that I must have been making a silly and stupid “mistake,” but I could not have figured it out. The confusing and misleading part was that when I was originally developing the app with the “cacheComponents” turned off, I would never get any kind of errors even after deploying. The core issue, which was the wrong file structure (more about this in a second), did not stop the app from working even after deploying. After enabling the “cacheComponents” feature (I am still using the wrong file structure), everything functions properly on my development machine. However, after deployment, it begins to crash with “404” errors. Link prefetching fails to work, and modals sometimes open and sometimes do not. To avoid boring you further and embarrassing myself in the process, here is the key section from the excellent Next.js documentation that I should have reviewed more often: Specifically the part:
So, adding one little “default.tsx” below solved all my problems:
|
Beta Was this translation helpful? Give feedback.







Hi, I'm encountering the same error, currently my work around is turn that intercepted parralel route into a 'use client' file, then use the fetch function with 'use cache' in useEffect.