next.js
next.js copied to clipboard
Parallel + Intercepted route causes 404 when setting cookie in Server Action
Link to the code that reproduces this issue
https://github.com/mordechaim/intercepted-not-found
To Reproduce
- Check out deployment at https://intercepted-not-found.vercel.app/
- Hard navigate to login page https://intercepted-not-found.vercel.app/login
- Set cookie action: works perfectly.
- Soft navigate to login page from home via link
- Set cookie action in intercepted form: 404
Current vs. Expected behavior
When setting cookie, or any other server action that clear the client-side router cache, there's an error in the console:
No default component was found for a parallel route rendered on this page. Falling back to nearest NotFound boundary.
Learn more: https://nextjs.org/docs/app/building-your-application/routing/parallel-routes#defaultjs
The main page then changes to a 404, while the intercepted page is still present all the way at the bottom.
I would expect the form to behave exactly the same regardless if the router cache is cleared or not.
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Home
Binaries:
Node: 20.5.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 14.1.1-canary.4 // Latest available version is detected (14.1.1-canary.4).
eslint-config-next: 14.1.1-canary.4
react: 18.2.0
react-dom: 18.2.0
typescript: 5.3.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
App Router, Routing (next/router, next/navigation, next/link)
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local), Vercel (Deployed)
Additional context
No response
Similar issue, setting cookie in a server action works perfect, however, if we run into notFound
route, the server action blows up after successfully running, causing a 500.
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.