vercel / vercel/next.js

default.tsx parallel routes are using the loading.tsx from the parent route instead of the one from the parallel route

Open
#65,533 3 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Parallel & Intercepting Routes
Dominant language
JavaScript
Stars
142k
Forks
32.5k
Avg merge
2d 14h
Merged PRs (30d)
351

Description

Link to the code that reproduces this issue

https://github.com/nuclei272/parallel-route-loading-ui-bug

To Reproduce
  1. Go to https://codesandbox.io/p/github/nuclei272/parallel-route-loading-ui-bug/main.
  2. Click on the button to navigate to "/comments" route.
  3. Click on the button to do a hard refresh.
Current vs. Expected behavior

When you click to hard refresh, you'll see that the header and sidebar parallel routes (@header and @sidebar) will incorrectly displays "Loading Children...", which is the loading.tsx on the parent route /. The children page displays the loading.tsx correctly and the route /comments is also displaying it correctly.

The expected behaviour would be to loading the corresponding loading.tsx on @header and @sidebar parallel routes as seen when we first load the page on the root route /.

Provide environment information
Operating System:
  Platform: win64
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 15694
  Available CPU cores: 4
Binaries:
  node: 21.2.0
  yarn: 1.22.21
Relevant Packages:
  next: 14.3.0-canary.49 // Latest available version is detected (14.3.0-canary.49).
  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)

Parallel & Intercepting Routes

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

next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction and compare the root loading.tsx with the loading.tsx files under the @header and @sidebar parallel routes during navigation and hard refresh. Trace the default.tsx handling for /comments, then verify that each parallel route displays its own loading UI rather than the parent route's message.

Written by the indexing model from the issue text.

Assessment

Tech stack
next.js, react
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.