Skip to content

Commit 4212a86

Browse files
ztannerhuozhi
authored andcommitted
switch to slice in createRuntimePrefetchTransformStream (#85822)
It's safer to copy here than to pass a reference, because it's possible that the underlying chunk became detached. Accidentally tweaked this before landing #85595
1 parent 07a8657 commit 4212a86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/next/src/server/app-render/app-render.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ function createRuntimePrefetchTransformStream(
11291129
controller.enqueue(replace)
11301130
// If there are bytes in the currentChunk after the match enqueue them
11311131
if (currentIndex + searchLen < currentChunk.length) {
1132-
controller.enqueue(currentChunk.subarray(currentIndex + searchLen))
1132+
controller.enqueue(currentChunk.slice(currentIndex + searchLen))
11331133
}
11341134
// If we have a next chunk we enqueue it now
11351135
if (nextChunk) {

0 commit comments

Comments
 (0)