Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Page with fetch() call and cache: "no-store" does not switch to Dynamic Rendering #64462

@josecoelho96

Description

@josecoelho96

Link to the code that reproduces this issue

https://codesandbox.io/p/sandbox/dynamic-rendering-with-fetch-k72l9n

To Reproduce

  1. Build the application - rpm run build
  2. Observe output. Errors will appear on terminal. Focus on TypeError: fetch failed

Current vs. Expected behavior

From what I understood from the documentation, if a request is made to some API and the option cache is set to "no-store", nextjs would switch to Dynamic Rendering. From the build output it appears that it isn't doing so. I was expecting no calls during build time.

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
  Available memory (MB): 4102
  Available CPU cores: 2
Binaries:
  Node: 20.9.0
  npm: 9.8.1
  Yarn: 1.22.19
  pnpm: 8.10.2
Relevant Packages:
  next: 14.2.0-canary.9 // There is a newer canary version (14.2.1-canary.4) available, please upgrade! 
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Not sure, App Router

Which stage(s) are affected? (Select all that apply)

next build (local)

Additional context

I'm fairly new to nextjs so I might be misunderstanding some stuff. I stopped trying on my real project, did a new example and had the same problem.

I also tried to upgrade to the latest canary but got a bunch of errors, so I decided to submit this with the canary I got from the starting template.

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