[{"additions":59,"author":{"id":"U_kgDOD1JpZw","is_bot":false,"login":"youngsyre26","name":""},"body":"## Description\n\nAdds a new getting started guide for Next.js Middleware, covering:\n- Basic middleware setup\n- Overview of middleware capabilities\n- Links to existing documentation\n\n## Related\n\n- https://nextjs.org/docs/app/building-your-application/routing/middleware","changedFiles":1,"deletions":0,"labels":[{"id":"LA_kwDOBC3Cis7ZQfu6","name":"Documentation","description":"Related to Next.js' official documentation.","color":"C2E0C6"}],"number":90342,"title":"docs: add middleware overview guide"},{"additions":0,"author":{"id":"U_kgDODOWLjA","is_bot":false,"login":"poria-lang","name":"Poria"},"body":"1. **Async Request API Alignment**: Refactored `ClientPageRoot` and `ClientSegmentRoot` to receive and handle `params` and `searchParams` as Promises from the server. This aligns with Next.js 15+ patterns and reduces synchronous data handling in client-side root components.\r\n2. **Bug Fix in Rendering Logic**: Fixed `createErrorBoundaryClientSegmentRoot` in `create-component-tree.tsx` which was incorrectly passing a `params` prop instead of `serverProvidedParams` to `ClientSegmentRoot`.\r\n3. **DX Improvement for CSRF Errors**: Updated the generic \"Invalid Server Actions request\" error in `action-handler.ts` to include specific details about origin and host mismatches, aiding developers in debugging proxy configurations.\r\n4. **Codemod Enhancements**:\r\n - `next-lint-to-eslint-cli`: Added support for `as const` assertions and `defineConfig` wrapper functions in flat ESLint configs.\r\n - `metadata-to-viewport-export`: Improved the property key matching to support literal keys and relaxed the search for the `metadata` object to handle varied export styles by looking at variable declarations.","changedFiles":0,"deletions":0,"labels":[],"number":90322,"title":"Identify actionable bugs and technical debt in core packages"},{"additions":20,"author":{"id":"U_kgDOBycpzw","is_bot":false,"login":"devjiwonchoi","name":"Jiwon Choi"},"body":"### Why?\r\n\r\nMake it easier for reviewers to test changes from a PR by showing the tarball install command directly in the next-stats-action comment.\r\n\r\n### How?\r\n\r\nAdded `generatePrTarballSection()` to `add-comment.js` that appends a \"Next.js Tarball from current PR\" section to the stats comment with the install command:\r\n\r\n```\r\nnext@https://vercel-packages.vercel.app/next/prs/<pr-number>/next\r\n```\r\n\r\n<img width=\"1790\" height=\"680\" alt=\"CleanShot 2026-02-21 at 16 48 28@2x\" src=\"https://github.com/user-attachments/assets/8f5a1d84-da87-4a6f-a0a0-282cee490f23\" />\r\n\r\nThe section is skipped for release PRs and only shown when a valid PR number is available.\r\n\r\n### Testing Plan\r\n\r\n- Verify the stats comment on this PR includes the tarball section","changedFiles":1,"deletions":0,"labels":[{"id":"MDU6TGFiZWwzMTI5MTUzNTU3","name":"created-by: Next.js team","description":"PRs by the Next.js team.","color":"000000"}],"number":90316,"title":"Add PR tarball install note to stats comment"},{"additions":4,"author":{"id":"U_kgDOBycpzw","is_bot":false,"login":"devjiwonchoi","name":"Jiwon Choi"},"body":"## Summary\n\n- Fixes `route.replace is not a function` error when running `next build --debug-build-paths` on projects with parallel routes\n\n**Root cause:** Turbopack filters routes at the route level (e.g., `/parallel-test` includes all page entries), while JS route discovery filters at the file path level (e.g., only `app/parallel-test/page.tsx`). This causes the `appPathsManifest` to contain entries (like `/@sidebar/page`) that `mappedAppPages` doesn't have. The unguarded lookup at `mappedAppPages[originalPath].replace(...)` crashes on `undefined`.\n\n**Fix:** Added a guard to skip manifest entries that don't exist in `mappedAppPages`.\n\n## Test plan\n\n- [x] Verified `next build --debug-build-paths 'app/parallel-test/**/page.tsx'` succeeds on test fixture\n- [x] Verified other `--debug-build-paths` patterns still work (multi-page, pages-only, etc.)","changedFiles":1,"deletions":1,"labels":[{"id":"MDU6TGFiZWwxOTY1NjI1MDk3","name":"type: next","description":"","color":"f6aff7"},{"id":"MDU6TGFiZWwzMTI5MTUzNTU3","name":"created-by: Next.js team","description":"PRs by the Next.js team.","color":"000000"}],"number":90312,"title":"Fix route.replace crash with --debug-build-paths"},{"additions":83,"author":{"id":"U_kgDOCThJhg","is_bot":false,"login":"TheAbMehta","name":"Abhisar Mehta"},"body":"## Summary\n\nFixes #73796\n\nWhen using `\"type\": \"module\"` in `package.json`, `import.meta.resolve()` returns `file:///...` URLs instead of filesystem paths. The `cacheHandler` config option accepts these values, but several internal code paths used `path.isAbsolute()` checks that don't recognize `file://` protocol URLs, causing broken path concatenation (e.g., `.next/file:/path/to/handler.js`) and `ERR_MODULE_NOT_FOUND` errors.\n\n## Changes\n\n- **`packages/next/src/lib/format-dynamic-import-path.ts`**: Short-circuit for `file://` URLs since they're already valid import URLs — no need to convert to path and back.\n\n- **`packages/next/src/build/collect-build-traces.ts`**: Convert `file://` URLs to filesystem paths via `fileURLToPath()` before `path.isAbsolute()` check during build tracing.\n\n- **`packages/next/src/build/swc/index.ts`**: Convert `file://` URLs to filesystem paths for both `cacheHandler` and `cacheHandlers` config values before making them relative for Turbopack.\n\n- **`test/unit/format-dynamic-import-path.test.ts`**: Added unit tests covering relative paths, absolute paths, and `file://` URL inputs.\n\n## How to Reproduce\n\n1. Create a Next.js project with `\"type\": \"module\"` in `package.json`\n2. In `next.config.js`, set `cacheHandler: import.meta.resolve('./cache-handler.mjs')`\n3. Run `next build` → `ERR_MODULE_NOT_FOUND` because the path becomes `.next/file:/absolute/path/to/cache-handler.mjs`\n\nReproduction repo from issue: https://github.com/hdodov/test-nextjs/tree/cache-handler-not-working\n\n## Disclosure\n\nThis PR was authored with the assistance of Claude (LLM) to help understand the codebase and structure the implementation and description.","changedFiles":5,"deletions":20,"labels":[{"id":"MDU6TGFiZWwxOTY1NjI1MDk3","name":"type: next","description":"","color":"f6aff7"},{"id":"LA_kwDOBC3Cis8AAAABl3FxWw","name":"tests","description":"","color":"ededed"}],"number":90290,"title":"fix: handle file:// URLs in cacheHandler for ESM configs"}]