nextjs - 💡(How to fix) Fix Route groups in chunk paths not encoded [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#92890Fetched 2026-04-17 08:25:40
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
1
Author
Participants
Timeline (top)
issue_type_added ×1labeled ×1

Code Example

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.4.0: Thu Mar 19 19:30:44 PDT 2026; root:xnu-12377.101.15~1/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 24.14.1
  npm: 11.11.0
  Yarn: 1.22.22
  pnpm: 9.14.4
Relevant Packages:
  next: 16.2.1-canary.45 // Latest available version is detected (16.2.1-canary.45).
  eslint-config-next: N/A
  react: 19.2.5
  react-dom: 19.2.5
  typescript: 5.9.3
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/Netail/repro-next-url-encoding

To Reproduce

  1. pnpm install
  2. pnpm run dev
  3. Visit localhost:3000
  4. Open the network panel
  5. Visit any of the pages & check the page.js request

(You can also do this with a build, but the chunks ofc will look a little different)

  • [id] gets encoded to %5Bid%5D
  • [...catch] gets encoded to %5B...catch%5D
  • [[...catch]] gets encoded to %5B%5B...catch%5D%5D
  • (group) does not get encoded to %28group%29, but stays (group)

Current vs. Expected behavior

Route groups in chunk paths do not get encoded. (group) should become %28group%29, but stays (group).

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.4.0: Thu Mar 19 19:30:44 PDT 2026; root:xnu-12377.101.15~1/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 24.14.1
  npm: 11.11.0
  Yarn: 1.22.22
  pnpm: 9.14.4
Relevant Packages:
  next: 16.2.1-canary.45 // Latest available version is detected (16.2.1-canary.45).
  eslint-config-next: N/A
  react: 19.2.5
  react-dom: 19.2.5
  typescript: 5.9.3
Next.js Config:
  output: N/A

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

Route Handlers, Webpack

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

next dev (local), next build (local)

Additional context

This causes issues with certain infrastructure as it's not web compliant. Mainly webpack seems to be affected as turbopack generates chunk paths differently

extent analysis

TL;DR

The issue can be fixed by properly encoding route groups in chunk paths, possibly by adjusting Webpack configuration or Next.js settings to ensure compliance with web standards.

Guidance

  • Investigate Webpack configuration to see if there's an option to encode special characters in chunk paths, such as (group) to %28group%29.
  • Check Next.js documentation for any settings related to URL encoding, particularly for route groups.
  • Review the next version (16.2.1-canary.45) to see if this is a known issue or if there's an update that addresses URL encoding.
  • Consider using a custom Webpack plugin or configuration to manually encode special characters in chunk paths.

Example

No specific code example can be provided without further investigation into Webpack or Next.js configurations.

Notes

The issue seems to be related to how Webpack generates chunk paths, specifically with Next.js. The solution might involve adjusting configurations or using a custom plugin to ensure proper URL encoding.

Recommendation

Apply a workaround by investigating and adjusting Webpack configuration or Next.js settings to properly encode route groups in chunk paths, as upgrading to a fixed version is not clearly implied in the given information.

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