From 9b04e2e03d2361c917804e0876461d3add896ecf Mon Sep 17 00:00:00 2001 From: Niklas Fiekas Date: Fri, 22 Oct 2021 16:35:09 +0200 Subject: [PATCH] fix TextDecoder finalization in older chrome --- ui/common/src/ndjson.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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));