Skip to content

Loading state never finishes with nested dynamic layout using PPR #60202

@kevva

Description

@kevva

Link to the code that reproduces this issue

https://github.com/kevva/next-bugs/tree/routing-back

To Reproduce

  1. Build and start the application (npm run build && npm run start)
  2. Click the "Foo" link
  3. The loading UI never finishes and thus the route is never rendered

Current vs. Expected behavior

Current behaviour

Currently, if you have a loading.js and something dynamic in a nested layout.js (like a headers() call), the loading state will never finish if you navigate to the route with the nested layout using PPR.

Expected behaviour

The route renders correctly.

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000
Binaries:
  Node: 21.4.0
  npm: 10.2.4
  Yarn: 1.22.21
  pnpm: N/A
Relevant Packages:
  next: 14.0.5-canary.36
  eslint-config-next: 14.0.5-canary.36
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.3.3
Next.js Config:
  output: N/A

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

App Router

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

next start (local)

Additional context

The latest working canary release I could test this is in was 14.0.5-canary.19 due to issues introduced in #59569. However, it works in that release so this must've been introduced after that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.lockedstaleThe issue has not seen recent activity.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions