{"record":{"id":"d8cbb2784a75d7b5","repo":"vercel/next.js","slug":"request-body-exceeded-bytes-format-bodysizelimit","errorCode":null,"errorMessage":"Request body exceeded ${bytes.format(bodySizeLimit)}${urlInfo}. Only the first ${bytes.format(bodySizeLimit)} will be available unless configured. See https://nextjs.org/docs/app/api-reference/config/next-config-js/middlewareClientMaxBodySize for more details.","messagePattern":"Request body exceeded (.+?)(.+?)\\. Only the first (.+?) will be available unless configured\\. See https://nextjs\\.org/docs/app/api-reference/config/next-config-js/middlewareClientMaxBodySize for more details\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/server/body-streams.ts","lineNumber":101,"sourceCode":"      // `.push()`, it must be a plain Readable: a Duplex (PassThrough) would copy\n      // its writable-side internals (`_writableState`, `write`, `end`, ...) onto the\n      // IncomingMessage, making the request look like an unfinished writable stream\n      // and hanging Node stream APIs such as `Readable.toWeb()`.\n      const p2 = new Readable({ read() {} })\n\n      let bytesRead = 0\n      const bodySizeLimit = sizeLimit ?? DEFAULT_BODY_CLONE_SIZE_LIMIT\n      let limitExceeded = false\n\n      input.on('data', (chunk) => {\n        if (limitExceeded) return\n\n        bytesRead += chunk.length\n\n        if (bytesRead > bodySizeLimit) {\n          limitExceeded = true\n          const urlInfo = readable.url ? ` for ${readable.url}` : ''\n          console.warn(\n            // TODO(jiwon): Update this document link\n            `Request body exceeded ${bytes.format(bodySizeLimit)}${urlInfo}. Only the first ${bytes.format(bodySizeLimit)} will be available unless configured. See https://nextjs.org/docs/app/api-reference/config/next-config-js/middlewareClientMaxBodySize for more details.`\n          )\n          p1.push(null)\n          p2.push(null)\n          return\n        }\n\n        p1.push(chunk)\n        p2.push(chunk)\n      })\n      input.on('end', () => {\n        if (!limitExceeded) {\n          p1.push(null)\n          p2.push(null)\n        }\n      })\n      buffered = p2","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/server/body-streams.ts#L83-L119","documentation":"Error \"Request body exceeded ${bytes.format(bodySizeLimit)}${urlInfo}. Only the first ${bytes.format(bodySizeLimit)} will be available unless configured. See https://nextjs.org/docs/app/api-reference/config/next-config-js/middlewareClientMaxBodySize for more details.\" thrown in vercel/next.js.","triggerScenarios":"Thrown at packages/next/src/server/body-streams.ts:101 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the request body size, or increase `middlewareClientMaxBodySize` in next.config."],"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"}