vercel / next.js

The React Framework
https://nextjs.org
MIT License
127.47k stars 27.04k forks source link

Incremental Static Regeneration (ISR) Not Functioning as Expected in Next.js 15 #72456

Open samstr opened 3 weeks ago

samstr commented 3 weeks ago

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

  1. Clone demo repo (isr-demo-nextjs14)
  2. npm install
  3. npm run build
  4. Go to http://localhost:3000/ and click the example links

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 Screenshot 2024-11-07 at 10 51 33

NextJS 15 Screenshot 2024-11-07 at 10 59 05

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

astrodomas commented 2 days ago

Appears to not be working with 15.0.4-canary.31 aswell.

KraKeN-47 commented 5 hours ago

The regression appears to happened at next@15.0.0-canary.104