There was an error while loading. Please reload this page.
1 parent af827ad commit e21fadfCopy full SHA for e21fadf
2 files changed
.changeset/loose-stars-greet.md
@@ -0,0 +1,5 @@
1
+---
2
+"@solidjs/start": patch
3
4
+
5
+fix potentially incomplete first chunk for chunk readers
packages/start/src/fns/serialization.ts
@@ -167,10 +167,14 @@ export class SerovalChunkReader {
167
}
168
169
async next(): Promise<{ done: true; value: undefined } | { done: false; value: string }> {
170
- // Check if the buffer is empty
171
- if (this.buffer.length === 0) {
+ // Check if the buffer is empty or incomplete
+ if (this.buffer.length < 12) {
172
// if we are already done...
173
if (this.done) {
174
+ // incomplete stream
175
+ if (this.buffer.length !== 0) {
176
+ throw new Error("Malformed server function stream.");
177
+ }
178
return {
179
done: true,
180
value: undefined,
0 commit comments