Conversation
…2). When Next.js is the frontend, do not add the catch-all `^/api(/.*)?$` → 404 rewrite, so App Router API routes like `/api/blog/posts/[id]` are handled by Next.js instead of being 404'd by zero-config routes.
🦋 Changeset detectedLatest commit: a18f5c3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📦 CLI Tarball ReadyThe Vercel CLI tarball for this PR is now available! Quick TestYou can test this PR's CLI directly by running: npx https://vercel-2qo53qp1p.vercel.sh/tarballs/vercel.tgz --helpUse in vercel.jsonTo use this CLI version in your project builds, add to your {
"build": {
"env": {
"VERCEL_CLI_VERSION": "vercel@https://vercel-2qo53qp1p.vercel.sh/tarballs/vercel.tgz"
}
}
}Python Runtime WheelA Python Workers WheelA |
🧪 Unit Test StrategyComparing: Strategy: Affected packages only ✅ Only testing packages that have been modified or depend on modified packages. Affected packages - 3 (8%)
Unaffected packages - 37 (93%)
Results
This comment is automatically generated based on the affected testing strategy |
Removed filter for experimental fixture '06-services-multi-frontend-multi-runtime'.
…nts-return-404-on-vercel-despite
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @vercel/backends@0.0.40 ### Patch Changes - Updated dependencies \[[`9721f4948a72d273f792c54f5393aa50ac279209`](9721f49)]: - @vercel/build-utils@13.6.2 ## @vercel/build-utils@13.6.2 ### Patch Changes - add partialFallback flag to prerender output ([#14703](#14703)) ## @vercel/cervel@0.0.27 ### Patch Changes - Updated dependencies \[]: - @vercel/backends@0.0.40 ## vercel@50.25.6 ### Patch Changes - Updated dependencies \[[`9721f4948a72d273f792c54f5393aa50ac279209`](9721f49)]: - @vercel/build-utils@13.6.2 - @vercel/next@4.15.37 - @vercel/backends@0.0.40 - @vercel/elysia@0.1.43 - @vercel/express@0.1.52 - @vercel/fastify@0.1.46 - @vercel/go@3.4.3 - @vercel/h3@0.1.52 - @vercel/hono@0.2.46 - @vercel/hydrogen@1.3.5 - @vercel/koa@0.1.26 - @vercel/nestjs@0.2.47 - @vercel/node@5.6.10 - @vercel/python@6.19.0 - @vercel/redwood@2.4.9 - @vercel/remix-builder@5.6.0 - @vercel/ruby@2.3.2 - @vercel/rust@1.0.5 - @vercel/static-build@2.8.44 ## @vercel/client@17.2.51 ### Patch Changes - Updated dependencies \[[`9721f4948a72d273f792c54f5393aa50ac279209`](9721f49)]: - @vercel/build-utils@13.6.2 ## @vercel/elysia@0.1.43 ### Patch Changes - Updated dependencies \[]: - @vercel/node@5.6.10 ## @vercel/express@0.1.52 ### Patch Changes - Updated dependencies \[]: - @vercel/node@5.6.10 - @vercel/cervel@0.0.27 ## @vercel/fastify@0.1.46 ### Patch Changes - Updated dependencies \[]: - @vercel/node@5.6.10 ## @vercel/fs-detectors@5.8.15 ### Patch Changes - Fix App Router dynamic API routes returning 404 in production. When a project has both Next.js (App Router) and a root `api/` folder, zero-config added a catch-all `^/api(/.*)?# @vercel/fs-detectors → 404 in the filesystem phase, which runs before the rewrite phase where Next.js routes live. So requests like `/api/flow/hello/next`or`/api/blog/posts/5`matched the catch-all and never reached the Next.js route. When Next.js is the frontend we no longer add that rewrite so those routes are handled by Next.js. (Locally, only`next dev`worked;`vc dev\` had the same 404.) ([#15297](#15297)) ## @vercel/gatsby-plugin-vercel-builder@2.0.142 ### Patch Changes - Updated dependencies \[[`9721f4948a72d273f792c54f5393aa50ac279209`](9721f49)]: - @vercel/build-utils@13.6.2 ## @vercel/h3@0.1.52 ### Patch Changes - Updated dependencies \[]: - @vercel/node@5.6.10 ## @vercel/hono@0.2.46 ### Patch Changes - Updated dependencies \[]: - @vercel/node@5.6.10 ## @vercel/koa@0.1.26 ### Patch Changes - Updated dependencies \[]: - @vercel/node@5.6.10 ## @vercel/nestjs@0.2.47 ### Patch Changes - Updated dependencies \[]: - @vercel/node@5.6.10 ## @vercel/next@4.15.37 ### Patch Changes - add partialFallback flag to prerender output ([#14703](#14703)) ## @vercel/node@5.6.10 ### Patch Changes - Updated dependencies \[[`9721f4948a72d273f792c54f5393aa50ac279209`](9721f49)]: - @vercel/build-utils@13.6.2 ## @vercel/static-build@2.8.44 ### Patch Changes - Updated dependencies \[]: - @vercel/gatsby-plugin-vercel-builder@2.0.142 <!-- VADE_RISK_START --> > [!NOTE] > Low Risk Change > > This PR is an automated Changesets release that only bumps version numbers in package.json files and updates CHANGELOG.md files across multiple packages, with no code logic changes. > > - Version bumps in package.json files (patch versions) > - CHANGELOG.md updates documenting dependency updates > - Deleted changeset markdown files consumed by release process > > <sup>Risk assessment for [commit 00d9965](https://github.com/vercel/vercel/commit/00d9965d12c097c2375af4e717f17594ca2ed06c).</sup> <!-- VADE_RISK_END --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fix dynamic routes with [id] segments returning 404 on Vercel . When Next.js is the frontend, do not add the catch-all
^/api(/.*)?$→ 404 rewrite, so App Router API routes like/api/blog/posts/[id]are handled by Next.js instead of being 404'd by zero-config routes.Can be reproduced by deploying this repo and visiting
/api/flow/hello/next, which incorrectly 404s.Warning
High Risk Change
Changes routing logic in detect-builders.ts to skip adding catch-all 404 rewrite for /api routes when Next.js is the frontend, which alters request handling behavior in production deployments.
/api404 rewrite when Next.js detectedRisk assessment for commit a18f5c3.