-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
Incremental Static Regeneration (ISR) Not Functioning as Expected in Next.js 15 #72456
Comments
Appears to not be working with 15.0.4-canary.31 aswell. |
The regression appears to happened at |
@leerob @delbaoliveira is it me or this section of the docs is a bit confusing? docs: @samstr however, this is the correct example:
|
I believe we're talking about different things. That docs page is saying "statically render them the first time they're visited". Hence, the array is empty and they are not prerendered during the build. The default value for |
Maybe I didn't understand your statement however, the confusion I'm getting here is why do we need to use
The provided example achieves the authors requested behaviour by adding
|
Your code snippets there don't make sense to me – both have the |
The ISR docs provided example fetches posts and provides a couple of slugs during build. However, this raised github issue is talking about an example where you would pass an empty array to Also, the docs example is broken as of next v15 (await params needed). However, consider the docs example:
We refactor this to achieve ISR on demand with regeneration based on the issue ticket:
The 2nd snippet does not work on next v15- we get However, adding So again, the question is - is it an issue from the nextjs v15 side, a docs confusion or is this a misused configuration with the desired output? P.S tested with latest canary |
Good question. I was wrong, this did change with v15 with the caching changes:
Source: https://nextjs.org/docs/app/api-reference/functions/generate-static-params So, this is working as expected and documented, but should be in our upgrade guide 💯 |
Docs will be updated with the next release for the params issue: #73088 |
I'd say this
OR
|
Link to the code that reproduces this issue
https://github.com/samstr/isr-demo-nextjs15
To Reproduce
NextJS 14 Demo: https://github.com/samstr/isr-demo-nextjs14
NextJS 15 Demo: https://github.com/samstr/isr-demo-nextjs15
Current vs. Expected behavior
The expected behavior is for pages that implement ISR should be cached for the time specified using the revalidate const.
In NextJS14 this works, but in NextJS 15 I can't seem to get the same behavior.
The
npm run build
output treats the route differently.NextJS 14
NextJS 15
I understand that NextJS 15 introduced a new 'uncached by default' concept for route handlers and fetch requests etc, but I didn't think that was related to server rendered pages that are using
revalidate
.Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6020 Available memory (MB): 98304 Available CPU cores: 12 Binaries: Node: 18.18.0 npm: 9.8.1 Yarn: N/A pnpm: 7.22.0 Relevant Packages: next: 15.0.2 // Latest available version is detected (15.0.2). eslint-config-next: 15.0.2 react: 19.0.0-rc-02c0e824-20241028 react-dom: 19.0.0-rc-02c0e824-20241028 typescript: 5.6.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed)
Additional context
No response
The text was updated successfully, but these errors were encountered: