diff --git a/ui/common/src/ndjson.ts b/ui/common/src/ndjson.ts index 2f17fcba22..e24155ac16 100644 --- a/ui/common/src/ndjson.ts +++ b/ui/common/src/ndjson.ts @@ -23,7 +23,7 @@ export const readNdJson = const loop = (): Promise => stream.read().then(({ done, value }) => { - buf += decoder.decode(value, { stream: !done }); + buf += decoder.decode(value || new Uint8Array(), { stream: !done }); const parts = buf.split(matcher); if (!done) buf = parts.pop()!; for (const part of parts) if (part) processLine(JSON.parse(part));