Skip to content

[pull] canary from vercel:canary#794

Merged
pull[bot] merged 3 commits intocode:canaryfrom
vercel:canary
Feb 16, 2026
Merged

[pull] canary from vercel:canary#794
pull[bot] merged 3 commits intocode:canaryfrom
vercel:canary

Conversation

@pull
Copy link

@pull pull bot commented Feb 16, 2026

See Commits and Changes for more details.


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

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

mischnic and others added 3 commits February 16, 2026 09:21
Confirmed the fix locally on the original app I faced the issue with.

### Why?

When using `--debug-build-paths`, a pattern with a route group on
Turbopack, it fails with an error:

```
Error [PageNotFoundError]: Cannot find module for page: /nested
    at ignore-listed frames {
  code: 'ENOENT'
}
```

Current Behavior:
https://github.com/vercel/next.js/actions/runs/21544427008/job/62083680496?pr=89336#step:35:459

The bug lives in `crates/next-api/src/project.rs`, specifically in
`from_debug_build_paths()`. This function is responsible for deriving
route paths from debug build inputs, but it currently preserves route
groups when it shouldn’t.

With the current behavior, an input like `app/(group)/nested/page.tsx`
produces the output `/(group)/nested`. In other words, the route group
segment is kept in the generated path.

However, Turbopack route keys explicitly strip route groups. In
`next-core/src/next_app/mod.rs`, the conversion from `AppPage` to
`AppPath` removes route group segments. For the same input, Turbopack
expects the route key to be `/nested`, not `/(group)/nested`.

This mismatch causes a downstream failure. `from_debug_build_paths()`
produces `/(group)/nested`, while the Turbopack route key is `/nested`.
Since `should_include_app_route()` relies on an exact string match, the
comparison fails. As a result, the route is excluded, the module is
never compiled, and the error ultimately surfaces as a
`PageNotFoundError`.

### How?

Strip route group `(xxx)` and parallel route `@xxx` segments in
`from_debug_build_paths()` to match how Turbopack normalizes route keys.

---------

Co-authored-by: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
Explicitly document that Next.js waits for an async instrumentation
register function to complete before handling incoming requests, and
align wording between the guide and API reference.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
@pull pull bot locked and limited conversation to collaborators Feb 16, 2026
@pull pull bot added the ⤵️ pull label Feb 16, 2026
@pull pull bot merged commit ababa1b into code:canary Feb 16, 2026
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

Comments