{"record":{"id":"ab5fd13a7600f459","repo":"langgenius/dify","slug":"response-body-is-empty","errorCode":null,"errorMessage":"Response body is empty","messagePattern":"Response body is empty","errorType":"exception","errorClass":"NetworkError","httpStatus":null,"severity":"error","filePath":"sdks/nodejs-client/src/http/client.ts","lineNumber":336,"sourceCode":"  const timer = setTimeout(() => {\n    controller.abort(reason)\n  }, timeoutMs)\n  return {\n    signal: controller.signal,\n    reason,\n    cleanup: () => {\n      clearTimeout(timer)\n    },\n  }\n}\n\nconst parseResponseBody = async <TResponseType extends HttpResponseType>(\n  response: Response,\n  responseType: TResponseType,\n): Promise<ResponseDataFor<TResponseType>> => {\n  if (responseType === 'stream') {\n    if (!response.body) {\n      throw new NetworkError('Response body is empty')\n    }\n    return Readable.fromWeb(\n      response.body as unknown as Parameters<typeof Readable.fromWeb>[0],\n    ) as ResponseDataFor<TResponseType>\n  }\n\n  if (responseType === 'bytes' || responseType === 'arraybuffer') {\n    const bytes = Buffer.from(await response.arrayBuffer())\n    return bytes as ResponseDataFor<TResponseType>\n  }\n\n  if (response.status === 204 || response.status === 205 || response.status === 304) {\n    return null as ResponseDataFor<TResponseType>\n  }\n\n  const text = await response.text()\n  try {\n    return parseJsonLikeText(","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/sdks/nodejs-client/src/http/client.ts#L318-L354","documentation":"Error \"Response body is empty\" thrown in langgenius/dify.","triggerScenarios":"Thrown at sdks/nodejs-client/src/http/client.ts:336 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}