nextjs - 💡(How to fix) Fix Bug using app router with @slot and [...slug] then the slug array contains all pieces of the url [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#83940Fetched 2026-04-08 02:21:05
View on GitHub
Comments
0
Participants
1
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
renamed ×2issue_type_added ×1labeled ×1mentioned ×1

Code Example

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:30 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6020
  Available memory (MB): 65536
  Available CPU cores: 12
Binaries:
  Node: 22.18.0
  npm: 10.9.3
  Yarn: N/A
  pnpm: 10.14.0
Relevant Packages:
  next: 15.5.3 // Latest available version is detected (15.5.3).
  eslint-config-next: 15.5.3
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.9.2
Next.js Config:
  output: N/A

---

└── simple
    ├── @header
    │   ├── user
    │   │   └── [...slug]
    │   │       └── page.tsx
    │   └── default.tsx
    ├── user
    │   ├── stats
    │   │   └── page.tsx
    │   └── page.tsx
    ├── layout.tsx
    └── page.tsx
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/EloB/nextjs-slot-slug-bug

To Reproduce

  1. npm install
  2. npm run dev
  3. Visit http://localhost:3000/simple/user/stats

Current vs. Expected behavior

When using a parallel route slot (e.g. @header) with a nested catch-all (user/[...slug]), the params.slug passed to the slot includes ["simple", "user", "stats"] in the slug array. It should only include the segments after user/ in this case ["stats"].

Current output: <img width="268" height="165" alt="Image" src="https://github.com/user-attachments/assets/a6c7da41-5a5d-4068-8fe4-9c6ce5d416ae" />

Expected output: <img width="268" height="133" alt="Image" src="https://github.com/user-attachments/assets/f3439bdf-b747-4b2a-8d39-e25cafe92923" />

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:30 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6020
  Available memory (MB): 65536
  Available CPU cores: 12
Binaries:
  Node: 22.18.0
  npm: 10.9.3
  Yarn: N/A
  pnpm: 10.14.0
Relevant Packages:
  next: 15.5.3 // Latest available version is detected (15.5.3).
  eslint-config-next: 15.5.3
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.9.2
Next.js Config:
  output: N/A

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

Dynamic Routes

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

next dev (local)

Additional context

Here you can easily verify it. https://codesandbox.io/p/devbox/6sdcq3?embed=1 https://6sdcq3-3000.csb.app/simple/user/stats

└── simple
    ├── @header
    │   ├── user
    │   │   └── [...slug]
    │   │       └── page.tsx
    │   └── default.tsx
    ├── user
    │   ├── stats
    │   │   └── page.tsx
    │   └── page.tsx
    ├── layout.tsx
    └── page.tsx

extent analysis

TL;DR

The issue can be fixed by adjusting the routing configuration to correctly handle parallel route slots with nested catch-all routes.

Guidance

  • Review the Next.js documentation on dynamic routes and parallel route slots to understand how routing is resolved.
  • Verify that the page.tsx file in the @header/user/[...slug] directory is correctly handling the params.slug array.
  • Check the next.config.js file for any custom routing configurations that may be affecting the behavior.
  • Test the application with different routing scenarios to ensure the fix works as expected.

Example

No code snippet is provided as the issue is related to routing configuration and the fix may vary depending on the specific use case.

Notes

The issue seems to be specific to the next dev stage and may not affect production builds. However, it's essential to verify the fix in both development and production environments to ensure consistency.

Recommendation

Apply a workaround by adjusting the routing configuration to correctly handle parallel route slots with nested catch-all routes, as the root cause of the issue is likely related to the routing configuration.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - 💡(How to fix) Fix Bug using app router with @slot and [...slug] then the slug array contains all pieces of the url [1 participants]