URL decoding issue in dynamic routes with cacheComponents enabled.
The issue occurs when navigating to dynamic routes containing '%25' with cacheComponents enabled, causing a 500 Internal Server Error. The problem involves URL decoding logic in the caching mechanism. The fix requires ensuring the parameter is not prematurely decoded.
https://github.com/therungg/next-percentage-cache-bug-repro
cacheComponents in next.config.tsnpm run build && npm run start (it is not reproducable with npm run dev)http://localhost:3000/%25Any dynamic route with %25 in the parameter breaks. %24 or other url encoded characters work fine.
Breaks on both Turbopack and Webpack
Disabling cacheComponents removes the bug
When navigating to a dynamic route with a %25 anywhere in the dynamic parameter, and I have cacheComponents enabled, it will give a 500 Internal Server Error.
I expect the page to load fine and to url-decode the character correctly to %.
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025
Available memory (MB): 8937
Available CPU cores: 16
Binaries:
Node: 22.13.1
npm: 10.9.2
Yarn: N/A
pnpm: 10.0.0
Relevant Packages:
next: 16.1.0-canary.16 // Latest available version is detected (16.1.0-canary.16).
eslint-config-next: N/A
react: 19.2.1
react-dom: 19.2.1
typescript: 5.9.3
Next.js Config:
output: N/A
cacheComponents
next start (local)
No response
Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!