-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
revalidatePath()
does not revalidate layout when followed by redirect()
#70483
Comments
I was about to create an issue myself when I found this one. This bug has been a source of many problems for us. It occurs only when calling |
Commenting out the following code fixes this issue: next.js/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts Lines 256 to 293 in c3006f6
More specifically, just commenting out the However, commenting out the above lines results in refetching the RSC payload of the root layout twice instead of just once, which is obviously not an elegant solution. |
…tes + redirects (#70715) If a server action redirects, we reject the promise eagerly with a redirect error, but that means we skip the handling that clears the client router cache in case the response was revalidated. This keeps the existing handling to seed the prefetch cache & reject the promise but ensures we've had a chance to apply the flight data to the router state. Fixes #70483 Closes NDX-357
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. |
Link to the code that reproduces this issue
https://github.com/tom-sherman/next-redirect-revalidate-bug
To Reproduce
Current vs. Expected behavior
Current behaviour:
Layout is not revalidated/refreshed
Expected behaviour:
Layout to be revalidated
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.6.0: Wed Jul 31 20:49:39 PDT 2024; root:xnu-10063.141.1.700.5~1/RELEASE_ARM64_T6000 Available memory (MB): 16384 Available CPU cores: 8 Binaries: Node: 20.9.0 npm: 10.5.0 Yarn: 1.22.19 pnpm: 9.1.0 Relevant Packages: next: 15.0.0-canary.168 // Latest available version is detected (15.0.0-canary.168). eslint-config-next: N/A react: 19.0.0-rc-5d19e1c8-20240923 react-dom: 19.0.0-rc-5d19e1c8-20240923 typescript: 5.3.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Navigation
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local), Vercel (Deployed)
Additional context
This works on v15 RC but broken on latest canary.
The text was updated successfully, but these errors were encountered: