-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Page not revalidated when fetch no longer returns 404 #73973
Comments
I'm having the same issue. It's driving me a bit crazy since I've been debugging this issue for a whole day. I thought the problem was in our Next.js app or in our library. My conclusion: Repo: https://github.com/fikrikarim/nextjs-revalidate-tag-404-bug Live link: https://revalidate-tag-404-bug.vercel.app/ revalidation-404-bug-small.mp4 |
Might be related: #66540 |
Created a smaller repro that doesn't require Redis or any Bisected with my repro and found that |
May be solved by #74577? |
This ensures we don't lose tags added to a page before `notFound()` is called as otherwise a fetch on the page that has been revalidated won't be able to be applied correctly if dropped from a `notFound()` call. This was broken recently in the refactors of handling rendering in app-render as it worked correctly in `v14`. x-ref: [slack thread](https://vercel.slack.com/archives/C04V3E1UYNQ/p1736200963684869) Closes https://linear.app/vercel/issue/ENET-1381 Closes https://linear.app/vercel/issue/NEXT-3946 Closes #73973 Closes #66540
Confirming that this is solved by upgrading to NextJS v15.1.4: joostmeijles/cache-revalidate-404-issue@4dc962c |
I also confirm that this solves the issue in our project |
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/joostmeijles/cache-revalidate-404-issue
To Reproduce
Current vs. Expected behavior
The page is not revalidated after the underlying cached fetch value was updated and cached item revalidated. Revalidation has no effect on this. I expect the page to be regenerated when the cached value is revalidated.
Details
The rendered page retrieves the data from the backend using a fetch call. The fetch call has the following properties set:
After the page rendered a 404 cache revalidation no longer works, i.e. the page is never re-rendered.
Provide environment information
Which area(s) are affected? (Select all that apply)
Runtime
Which stage(s) are affected? (Select all that apply)
Vercel (Deployed)
Additional context
This can be reproduced locally in production mode by
npm run build
andnpm run start
.NB. Set
VERCEL_URL="cache-revalidate-404-issue.vercel.app"
in your env for the page pre-render to work.The text was updated successfully, but these errors were encountered: