vercel/next.js · error
API resolved without sending a response for ${req.url}, this
Error message
API resolved without sending a response for ${req.url}, this may result in stalled requests. What it means
apiResolver detects (dev only) that the handler resolved without the response having been ended or piped, i.e. no response was ever sent; it warns because the request will hang until timeout — the handler forgot res.send/res.json/res.end.
Source
Thrown at packages/next/src/server/api-utils/node/api-resolver.ts:451
res.once('pipe', () => (wasPiped = true))
}
const apiRouteResult = await resolver(req, res)
if (process.env.NODE_ENV !== 'production') {
if (typeof apiRouteResult !== 'undefined') {
if (apiRouteResult instanceof Response) {
throw new Error(
'API route returned a Response object in the Node.js runtime, this is not supported. Please use `runtime: "edge"` instead: https://nextjs.org/docs/api-routes/edge-api-routes'
)
}
console.warn(
`API handler should not return a value, received ${typeof apiRouteResult}.`
)
}
if (!externalResolver && !isResSent(res) && !wasPiped) {
console.warn(
`API resolved without sending a response for ${req.url}, this may result in stalled requests.`
)
}
}
} catch (err) {
await onError?.(
err,
{
method: req.method || 'GET',
headers: req.headers,
path: req.url || '/',
},
{
routerKind: 'Pages Router',
routePath: page || '',
routeType: 'route',
revalidateReason: undefined,
}View on GitHub (pinned to 0eb3775416)
Solutions
- Ensure every code path in the API handler sends a response (res.send/json/end).
- Await async operations before the handler returns.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/next/src/server/api-utils/node/api-resolver.ts:451 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of vercel/next.js@0eb3775416 (2026-08-19).
Data as JSON: /api/errors/285d5fb19e888e7a.
Report an issue: GitHub.