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

Static and dynamic parallel routes not working together as expected #70366

Closed
tswymer opened this issue Sep 23, 2024 · 3 comments · Fixed by #70386
Closed

Static and dynamic parallel routes not working together as expected #70366

tswymer opened this issue Sep 23, 2024 · 3 comments · Fixed by #70386
Labels
bug Issue was opened via the bug report template. Parallel & Intercepting Routes Related to Parallel and/or Intercepting routes.

Comments

@tswymer
Copy link

tswymer commented Sep 23, 2024

Link to the code that reproduces this issue

https://github.com/tswymer/static-parallel-routes-reproduction

To Reproduce

  1. Since this is a caching issue it can only be reproduced in prod mode, so build and start the repo (or https://static-parallel-routes-reproduction.vercel.app/)
  2. Observe app root is correctly statically pre-rendered and cached, then click the link to go to "/test"
  3. Observe all sections on /test are dynamically rendered

Current vs. Expected behavior

I expected the test/layout.tsx, test/page.tsx and test/@staticRoute/page.tsx pages to be static, but the test/@dynamicRoute/page.tsx seems to cause the entire "/test" path to become dynamic.

Also enabling partial pre-rendering does not change the observed behavior.

app
├── layout.tsx
├── page.tsx (static)
└── test
    ├── @dynamicRoute
    │   └── page.tsx (dynamic)
    ├── @staticRoute
    │   └── page.tsx (expected to be static, is dynamic)
    ├── layout.tsx (expected to be static, is dynamic)
    └── page.tsx (expected to be static, is dynamic)

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.0.0: Mon Aug 12 20:52:12 PDT 2024; root:xnu-11215.1.10~2/RELEASE_ARM64_T6020
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 22.7.0
  npm: 10.8.2
  Yarn: N/A
  pnpm: 8.15.3
Relevant Packages:
  next: 15.0.0-canary.163 // Latest available version is detected (15.0.0-canary.163).
  eslint-config-next: N/A
  react: 19.0.0-rc-e740d4b1-20240919
  react-dom: 19.0.0-rc-e740d4b1-20240919
  typescript: 5.3.3
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 build (local), next start (local), Vercel (Deployed), Other (Deployed)

Additional context

No response

@tswymer tswymer added the bug Issue was opened via the bug report template. label Sep 23, 2024
@github-actions github-actions bot added the Parallel & Intercepting Routes Related to Parallel and/or Intercepting routes. label Sep 23, 2024
@samcx
Copy link
Member

samcx commented Sep 24, 2024

@tswymer Thank you for sharing! I was able to replicate.

Will get back to you on this!

@samcx
Copy link
Member

samcx commented Sep 24, 2024

@tswymer To confirm, this is expected, since Slots are technically stitched together to create a Page. So you cannot have different different rendering for slots at the same route level.

Upon checking the documentation, we definitely need to address this point! Will be creating a docs PR to address this before closing this PR.

@tswymer
Copy link
Author

tswymer commented Sep 24, 2024

Thanks for confirming @samcx, looking at the docs again it does clearly state that these slots are not route segments, but the addition you have added to the docs definitely helps my understanding!

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. Parallel & Intercepting Routes Related to Parallel and/or Intercepting routes.
Projects
None yet
2 participants