default.tsx parallel routes are using the loading.tsx from the parent route instead of the one from the parallel route
Nobody has claimed this yet.
- 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
- Go to
https://codesandbox.io/p/github/nuclei272/parallel-route-loading-ui-bug/main. - Click on the button to navigate to "/comments" route.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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