You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/next/src/server/stream-utils/node-web-streams-helper.ts
+22-17
Original file line number
Diff line number
Diff line change
@@ -196,7 +196,6 @@ function createHeadInsertionTransformStream(
196
196
insert: ()=>Promise<string>
197
197
): TransformStream<Uint8Array,Uint8Array>{
198
198
letinserted=false
199
-
letfreezing=false
200
199
201
200
// We need to track if this transform saw any bytes because if it didn't
202
201
// we won't want to insert any server HTML at all
@@ -205,32 +204,35 @@ function createHeadInsertionTransformStream(
205
204
returnnewTransformStream({
206
205
asynctransform(chunk,controller){
207
206
hasBytes=true
208
-
// While react is flushing chunks, we don't apply insertions
209
-
if(freezing){
210
-
controller.enqueue(chunk)
211
-
return
212
-
}
213
207
214
208
constinsertion=awaitinsert()
215
-
216
209
if(inserted){
217
210
if(insertion){
218
211
constencodedInsertion=encoder.encode(insertion)
219
212
controller.enqueue(encodedInsertion)
220
213
}
221
214
controller.enqueue(chunk)
222
-
freezing=true
223
215
}else{
224
216
// TODO (@Ethan-Arrowood): Replace the generic `indexOfUint8Array` method with something finely tuned for the subset of things actually being checked for.
0 commit comments