Production down — React Router 7 SSR function crashes: ERR_MODULE_NOT_FOUND for react-router/dist/development/index.mjs
Severity: Production outage — no working deployment to roll back to
Plan: Hobby
Project: https://vercel.com/chunk-creations/model-box-app
Failing deployment: https://vercel.com/chunk-creations/model-box-app/HZpBK72oiF6KdqTghZp1b3xDLm4D
Regression observed from: 2026-05-18 18:23:18 UTC (deploy of merge commit 6bfefb156fab835e13f60c9d96117255c8bf5c2b)
Summary
Since 2026-05-18 ~18:23 UTC, every deployment of our React Router 7 SSR
app crashes at runtime with FUNCTION_INVOCATION_FAILED. The serverless
function cannot find react-router/dist/development/index.mjs — that file is
imported by the builder-generated server-index.mjs but is not traced into
the deployed function bundle.
This is not a code regression: I checked deployments as far back as
May 14 — every one of them, including previously-working immutable
deployments, now crashes identically. They all worked before the timestamp
above. When all immutable historical deployments fail simultaneously, the cause
is a platform/builder-side change, not our code — and it means we have no
working deployment to roll back to.
Error (runtime, cold start)
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/var/task/node_modules/react-router/dist/development/index.mjs' imported from /var/task/apps/app/build/server/nodejs_eyJydW50aW1lIjoibm9kZWpzIn0/server-index.mjs
at finalizeResolution (node:internal/modules/esm/resolve:281:11)
at moduleResolve (node:internal/modules/esm/resolve:871:10)
at moduleResolveWithNodePath (node:internal/modules/esm/resolve:997:14)
at defaultResolve (node:internal/modules/esm/resolve:1040:79)
at #cachedDefaultResolve (node:internal/modules/esm/loader:719:20)
at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:736:38)
at ModuleLoader.resolveSync (node:internal/modules/esm/loader:765:52)
at #resolve (node:internal/modules/esm/loader:701:17)
at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:621:35)
at ModuleJob.syncLink (node:internal/modules/esm/module_job:160:33) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///var/task/node_modules/react-router/dist/development/index.mjs'
}
Node.js process exited with exit status: 1.
The build succeeds; the crash is at function invocation / cold start.
Diagnosis
server-index.mjsis generated by Vercel’s builder (the@vercel/react-router
npm package is only a config preset — it writes a manifest and does not
generate the function entry). So the failing import is in builder-produced
code, not ours.react-router@7.13.1’spackage.jsonexports["."]resolves themodule-sync
condition to./dist/development/index.mjs. This is the canonical entry —
bothdist/developmentanddist/productionship in the package.- Node honors the
module-synccondition from 22.0.0 (backported to
20.19.0). I verified locally (Node v24):import.meta.resolve('react-router')
resolves todist/development/index.mjs— exactly the file the function
cannot find. - So the runtime correctly asks for
index.mjs, but the builder’s file tracer
did not packageindex.mjsinto the Lambda. This is a file-tracer ↔
runtime export-condition mismatch. - Likely trigger: our
engines.nodeis an unpinned">=20.9.0"range
(Vercel’s build log warns it “will automatically upgrade when a new major
Node.js Version is released”). A Vercel-side Node bump appears to have flipped
resolution onto themodule-sync.mjsentry that the tracer doesn’t ship.
What I’ve already tried
- Bumped
@vercel/react-router1.2.6 → 1.3.0 and redeployed → identical
crash (expected —server-index.mjsis builder-generated, not from the npm
preset). - Set
NODE_ENV=productionin project env → no change. - Not fixable by Node version: every Node version Vercel offers (20.19+, 22)
honorsmodule-sync, so the runtime resolves.mjsregardless. - Not fixable by pinning
react-router: themodule-sync→.mjs
condition is present in every recent 7.x release (checked 7.11 / 7.12 /
7.13.0 / 7.13.1 — identical). - Not using React Router middleware — this is distinct from issue #13327.
Environment
- React Router 7.13.1 (
react-router,@react-router/node,
@react-router/serve,@react-router/fs-routes,@react-router/dev) @vercel/react-router1.2.6 (also tried 1.3.0)- Monorepo: Turborepo + Bun workspaces; app at
apps/app vercel.json:framework: "react-router",
installCommand: "cd ../.. && bun install",
buildCommand: "cd ../.. && bun run build --filter=@modelbox/app",
outputDirectory: "build"engines.node:">=20.9.0"
Ask
Is there a known regression in the React Router builder / serverless-function
file-tracing currently rolling out across the build fleet? Production is fully
down with no rollback path. Happy to provide additional build IDs or a minimal
reproduction.