Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loading.tsx not affecting sub-routes in some cases #74412

Open
UltimateGG opened this issue Dec 30, 2024 · 2 comments
Open

loading.tsx not affecting sub-routes in some cases #74412

UltimateGG opened this issue Dec 30, 2024 · 2 comments
Labels
bug Issue was opened via the bug report template. Navigation Related to Next.js linking (e.g., <Link>) and navigation.

Comments

@UltimateGG
Copy link

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/jovial-shockley-7yn8kf?workspaceId=ws_RG1nRyxTaV3usxvsfBToRH

To Reproduce

  1. Click the link to go to the other route, notice it is delayed until the page appears
  2. Click the link go to back home, it also will delay until home appears
  3. If you manually refresh the page on either route, the Loading.tsx file will display properly

However, if you move the (groupA)/page.tsx up into the app/ folder, it works properly, including for the /other/[slug] route.

Current vs. Expected behavior

Current: loading.tsx only shows on page refresh, not client side navigations.
Expected: Loader should "trickle" down to the routes below.

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Home
  Available memory (MB): 32703
  Available CPU cores: 8
Binaries:
  Node: 20.11.0
  npm: 9.8.1
  Yarn: N/A
  pnpm: 9.15.1
Relevant Packages:
  next: 15.1.2 // There is a newer version (15.1.3) available, upgrade recommended!
  eslint-config-next: 15.1.2
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.2
Next.js Config:
  output: N/A
 ⚠ There is a newer version (15.1.3) available, upgrade recommended!

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

Navigation

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

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

Additional context

CSB is on latest canary

@UltimateGG UltimateGG added the bug Issue was opened via the bug report template. label Dec 30, 2024
@github-actions github-actions bot added the Navigation Related to Next.js linking (e.g., <Link>) and navigation. label Dec 30, 2024
@AliRazaDev27
Copy link

I have seen the same question asked many times before, Read the docs.
https://nextjs.org/docs/app/building-your-application/routing/loading-ui-and-streaming#instant-loading-states
image

@UltimateGG
Copy link
Author

Just to confirm, it is intentional that loading does not affect routes below?
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Navigation Related to Next.js linking (e.g., <Link>) and navigation.
Projects
None yet
Development

No branches or pull requests

2 participants