这是indexloc提供的服务,不要输入任何密码
Skip to content

Duplicated rsc request using route groups and dynamic staleTimes #86130

@arvidede

Description

@arvidede

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/sharp-neumann-7ks2ds

To Reproduce

  1. Start the application in development
  2. Open devtools
  3. Open page /
  4. Click on page 0
  5. Navigate back to /
  6. Click on page 1

Page 0

Image

Page 1

Image

This only happens when using page groups

- app/
  - (pages)/
    - 0/
      - page.tsx
    - 1/
      - page.tsx

and dynamic staleTimes set to anything non-zero

const nextConfig = {
  reactStrictMode: false,
  experimental: {
    staleTimes: {
      dynamic: 60,
    },
  },
}

Current vs. Expected behavior

Only one server component request is issued.

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.12.0
  npm: 10.5.0
  Yarn: 1.22.19
  pnpm: 8.15.6
Relevant Packages:
  next: 16.0.3 // Latest available version is detected (16.0.3).
  eslint-config-next: 15.2.0
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.8.3
Next.js Config:
  output: N/A

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

Route Groups

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

next dev (local), next start (local)

Additional context

This happens in dev and prod, with cacheComponents enabled and disabled, with and without a wrapping suspense boundary.

Setting a debugger on

cacheNode.lazyData = lazyData = fetchServerResponse(
shows that resolvedRsc really is null for the second request, even though the first request returned just fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Route GroupsRelated to Route Groups.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions