Skip to content

[pull] canary from vercel:canary#320

Merged
pull[bot] merged 4 commits into
code:canaryfrom
vercel:canary
Aug 27, 2025
Merged

[pull] canary from vercel:canary#320
pull[bot] merged 4 commits into
code:canaryfrom
vercel:canary

Conversation

@pull

@pull pull Bot commented Aug 27, 2025

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.3)

Can you help keep this open source service alive? 💖 Please sponsor : )

ztanner and others added 4 commits August 27, 2025 06:26
Fixes edge runtime pages with dynamic routes returning 500 errors when
the URL segment literally contains bracket syntax that matches the
folder name (e.g., accessing `/[id]` for a route defined as
`/[id]/page.tsx`).

The removal of web-server.ts in #81389 modified how route params were
extracted for dynamic routes. The route matcher in prepare() was being
created with the full internal page path (e.g., /[id]/page) which
generated a regex expecting /page at the end. However, actual URL
pathnames don't include the /page suffix, causing the matcher to fail
when trying to extract params. This issue specifically manifested when
the URL contained literal brackets (like /[id]), as the fallback param
extraction would fail and leave params empty, leading to the error.

This PR normalizes the page path using before creating the route matcher
in prepare(). This ensures the regex pattern matches the actual URL
pathname format (without /page suffix).

Fixes NEXT-4698
Writing to `join(next.testDir, '../package-lock.json')` breaks test isolation.
@pull pull Bot locked and limited conversation to collaborators Aug 27, 2025
@pull pull Bot added the ⤵️ pull label Aug 27, 2025
@pull pull Bot merged commit 8657188 into code:canary Aug 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants