{"record":{"id":"3a94f984a564ae70","repo":"GopeedLab/gopeed","slug":"sourcelabel-must-return-a-readablestream-got","errorCode":null,"errorMessage":"${sourceLabel} must return a ReadableStream, got ${getValueTypeName(value)}","messagePattern":"(.+?) must return a ReadableStream, got (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"pkg/download/engine/inject/stream/stream.js","lineNumber":534,"sourceCode":"\n  function getValueTypeName(value) {\n    if (value === null) {\n      return \"null\";\n    }\n    if (value === undefined) {\n      return \"undefined\";\n    }\n    if (value && value.constructor && typeof value.constructor.name === \"string\" && value.constructor.name) {\n      return value.constructor.name;\n    }\n    return typeof value;\n  }\n\n  function toReadableStreamReader(value, sourceLabel) {\n    if (value && typeof value.getReader === \"function\") {\n      return value.getReader();\n    }\n    throw new TypeError(sourceLabel + \" must return a ReadableStream, got \" + getValueTypeName(value));\n  }\n\n  async function openBlobReadable(blob, request) {\n    const { offset, end } = request;\n    const sliced = blob.slice(offset, end >= offset ? end + 1 : undefined);\n    if (sliced && typeof sliced.stream === \"function\") {\n      try {\n        const stream = sliced.stream();\n        if (stream && typeof stream.getReader === \"function\") {\n          return stream;\n        }\n      } catch (_) {\n      }\n    }\n    if (sliced && typeof sliced.arrayBuffer === \"function\") {\n      const buffer = await sliced.arrayBuffer();\n      return new ReadableStream({\n        start(controller) {","sourceCodeStart":516,"sourceCodeEnd":552,"githubUrl":"https://github.com/GopeedLab/gopeed/blob/7b7327ffb30816273a74b142cccc0bc10c5a4c67/pkg/download/engine/inject/stream/stream.js#L516-L552","documentation":"Error \"${sourceLabel} must return a ReadableStream, got ${getValueTypeName(value)}\" thrown in GopeedLab/gopeed.","triggerScenarios":"Thrown at pkg/download/engine/inject/stream/stream.js:534 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":"7b7327ffb30816273a74b142cccc0bc10c5a4c67","analyzedAt":"2026-08-16T02:51:03.250Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}