Skip to content

Commit 1eb23c3

Browse files
committed
fix: wrap fixture in try/catch for more understandable repro
1 parent 33be3eb commit 1eb23c3

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

fixtures/fizz-ssr-browser-streaming/index.html

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,26 @@ <h1>Fizz Example</h1>
9999
let decoder = new TextDecoder();
100100
let debugOutput = '';
101101

102-
while (!done) {
103-
const chunk = await reader.read();
104-
done = chunk.done;
102+
try {
103+
while (!done) {
104+
const chunk = await reader.read();
105+
done = chunk.done;
105106

106-
let output = decoder.decode(chunk.value);
107-
iframe.contentWindow.document.write(output);
108-
debugOutput += output;
109-
}
110-
111-
iframe.contentWindow.document.close();
107+
let output = decoder.decode(chunk.value);
108+
iframe.contentWindow.document.write(output);
109+
debugOutput += output;
110+
}
111+
} catch (e) {
112+
//
113+
} finally {
114+
iframe.contentWindow.document.close();
112115

113-
console.log(
114-
`DEBUG OUTPUT:\n\n` +
115-
`👀 Notice the invalid HTML chunk '<div hidden id="<div' 👀 \n\n` +
116-
debugOutput
117-
);
116+
console.log(
117+
`DEBUG OUTPUT:\n\n` +
118+
`👀 Notice the invalid HTML chunk '<div hidden id="<div' 👀 \n\n` +
119+
debugOutput
120+
);
121+
}
118122
}
119123
</script>
120124
</body>

0 commit comments

Comments
 (0)