{"record":{"id":"285d5fb19e888e7a","repo":"vercel/next.js","slug":"api-resolved-without-sending-a-response-for-req","errorCode":null,"errorMessage":"API resolved without sending a response for ${req.url}, this may result in stalled requests.","messagePattern":"API resolved without sending a response for (.+?), this may result in stalled requests\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/server/api-utils/node/api-resolver.ts","lineNumber":451,"sourceCode":"      res.once('pipe', () => (wasPiped = true))\n    }\n\n    const apiRouteResult = await resolver(req, res)\n\n    if (process.env.NODE_ENV !== 'production') {\n      if (typeof apiRouteResult !== 'undefined') {\n        if (apiRouteResult instanceof Response) {\n          throw new Error(\n            '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'\n          )\n        }\n        console.warn(\n          `API handler should not return a value, received ${typeof apiRouteResult}.`\n        )\n      }\n\n      if (!externalResolver && !isResSent(res) && !wasPiped) {\n        console.warn(\n          `API resolved without sending a response for ${req.url}, this may result in stalled requests.`\n        )\n      }\n    }\n  } catch (err) {\n    await onError?.(\n      err,\n      {\n        method: req.method || 'GET',\n        headers: req.headers,\n        path: req.url || '/',\n      },\n      {\n        routerKind: 'Pages Router',\n        routePath: page || '',\n        routeType: 'route',\n        revalidateReason: undefined,\n      }","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/server/api-utils/node/api-resolver.ts#L433-L469","documentation":"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.","triggerScenarios":"Thrown at packages/next/src/server/api-utils/node/api-resolver.ts:451 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure every code path in the API handler sends a response (res.send/json/end).","Await async operations before the handler returns."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}