{"record":{"id":"ae1bd6560e0a0311","repo":"langgenius/dify","slug":"legacy-formdata-must-be-a-readable-stream-when-use","errorCode":null,"errorMessage":"Legacy FormData must be a readable stream when used with fetch","messagePattern":"Legacy FormData must be a readable stream when used with fetch","errorType":"validation","errorClass":"FileUploadError","httpStatus":null,"severity":"error","filePath":"sdks/nodejs-client/src/http/client.ts","lineNumber":256,"sourceCode":"}\n\nconst prepareRequestBody = (\n  method: RequestMethod,\n  data: HttpRequestBody | undefined,\n): PreparedRequestBody => {\n  if (method === 'GET' || data === undefined) {\n    return {\n      body: undefined,\n      headers: {},\n      replayable: true,\n    }\n  }\n\n  if (isFormData(data)) {\n    if ('getHeaders' in data && typeof data.getHeaders === 'function') {\n      const readable = toNodeReadable(data)\n      if (!readable) {\n        throw new FileUploadError('Legacy FormData must be a readable stream when used with fetch')\n      }\n      return {\n        body: Readable.toWeb(readable) as BodyInit,\n        headers: getFormDataHeaders(data),\n        duplex: 'half',\n        replayable: false,\n      }\n    }\n    return {\n      body: data as BodyInit,\n      headers: getFormDataHeaders(data),\n      replayable: true,\n    }\n  }\n\n  if (typeof data === 'string') {\n    return {\n      body: data,","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/sdks/nodejs-client/src/http/client.ts#L238-L274","documentation":"Error \"Legacy FormData must be a readable stream when used with fetch\" thrown in langgenius/dify.","triggerScenarios":"Thrown at sdks/nodejs-client/src/http/client.ts:256 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"}