Skip to content

ISR: Cached 404 status never change even if page is not a not-found anymore #66540

@zecka

Description

@zecka

Link to the code that reproduces this issue

https://github.com/zeckaissue/nextjs-cache-404-status-update

To Reproduce

  1. npm install
  2. npm run demo
  3. Go to: http://localhost:3000/hello-2
  4. edit demo/articles.json and modifiy slug from hello to hello-2
  5. Refresh http://localhost:3000/hello-2 until “Hello world” appears
  6. Chek network tab and http://localhost:3000/hello-2 still with a 404 status

Current vs. Expected behavior

Instead of got a 200 status we got a 404

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 18.18.2
  npm: 9.8.1
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  next: 14.2.3 // Latest available version is detected (14.2.3).
  eslint-config-next: 14.2.3
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.4.5
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 build (local)

Additional context

bug-cache-next.mov

I discovered this bug on a project much larger than the reproduction link. We use a cache handler with Redis and the problem is the same.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.locked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions