{"record":{"id":"ead0484213ab65bf","repo":"vuejs/core","slug":"readablestream-constructor-is-not-available-in-the","errorCode":null,"errorMessage":"ReadableStream constructor is not available in the global scope. If the target environment does support web streams, consider using pipeToWebWritable() with an existing WritableStream instance instead.","messagePattern":"ReadableStream constructor is not available in the global scope\\. If the target environment does support web streams, consider using pipeToWebWritable\\(\\) with an existing WritableStream instance instead\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/server-renderer/src/renderToStream.ts","lineNumber":150,"sourceCode":"    push(content) {\n      if (content != null) {\n        writable.write(content)\n      } else {\n        writable.end()\n      }\n    },\n    destroy(err) {\n      writable.destroy(err)\n    },\n  })\n}\n\nexport function renderToWebStream(\n  input: App | VNode,\n  context: SSRContext = {},\n): ReadableStream {\n  if (typeof ReadableStream !== 'function') {\n    throw new Error(\n      `ReadableStream constructor is not available in the global scope. ` +\n        `If the target environment does support web streams, consider using ` +\n        `pipeToWebWritable() with an existing WritableStream instance instead.`,\n    )\n  }\n\n  const encoder = new TextEncoder()\n  let cancelled = false\n\n  return new ReadableStream({\n    start(controller) {\n      renderToSimpleStream(input, context, {\n        push(content) {\n          if (cancelled) return\n          if (content != null) {\n            controller.enqueue(encoder.encode(content))\n          } else {\n            controller.close()","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/vuejs/core/blob/a2b40db9a83b36ed9da3a16403cf8f040262d73f/packages/server-renderer/src/renderToStream.ts#L132-L168","documentation":"Thrown by renderToWebStream in @vue/server-renderer when the global ReadableStream constructor is missing (`typeof ReadableStream !== 'function'`). Web Streams must be globally available for this entry point; older Node versions and some runtimes lack it. renderToStream.ts:150 fails fast and points to pipeToWebWritable() with a caller-supplied WritableStream as the alternative.","triggerScenarios":"Calling renderToWebStream(input) on a Node version below 18 (or an environment) without a global ReadableStream; running SSR on a runtime that polyfills fetch but not Web Streams.","commonSituations":"SSR on Node 16 or earlier; edge workers/sandboxes without full Web Streams; an SSR server upgraded to a newer @vue/server-renderer while staying on an older Node.","solutions":["Upgrade to Node 18+ (or a runtime) that provides a global ReadableStream.","Polyfill the global: `globalThis.ReadableStream = require('node:stream/web').ReadableStream` before importing the renderer.","Switch to pipeToWebWritable(app, {}, existingWritableStream) passing a stream you construct yourself.","Use renderToNodeStream/pipeToNodeWritable (CJS) if you cannot add Web Streams."],"exampleFix":"// before (Node < 18, no global ReadableStream)\nconst stream = renderToWebStream(app)\n\n// after — polyfill, then call\nimport { ReadableStream } from 'node:stream/web'\nglobalThis.ReadableStream = globalThis.ReadableStream || ReadableStream\nconst stream = renderToWebStream(app)","handlingStrategy":"validation","validationCode":"// Check Web Streams availability before renderToWebStream.\nfunction supportsWebStreams() {\n  return typeof ReadableStream === 'function'\n}\nif (!supportsWebStreams()) {\n  throw new Error('Upgrade to Node 18+ or polyfill globalThis.ReadableStream')\n}","typeGuard":"function hasGlobalReadableStream(): boolean {\n  return typeof (globalThis as any).ReadableStream === 'function'\n}","tryCatchPattern":null,"preventionTips":["Run SSR on Node 18+ where Web Streams are global.","Polyfill globalThis.ReadableStream from node:stream/web at process start if you must support older Node.","Prefer pipeToWebWritable(app, {}, writable) with a caller-created WritableStream for portability."],"tags":["vue","server-renderer","ssr","web-streams","node-version","configuration"],"backgroundTag":null,"analyzedSha":"a2b40db9a83b36ed9da3a16403cf8f040262d73f","analyzedAt":"2026-08-12T14:21:14.989Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}