File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
packages/next/src/server/app-render Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { isPrerenderInterruptedError } from './dynamic-rendering'
77 */
88export function prerenderAndAbortInSequentialTasks < R > (
99 prerender : ( ) => Promise < R > ,
10- abort : ( ) => void
10+ abort : ( ) => Promise < void >
1111) : Promise < R > {
1212 if ( process . env . NEXT_RUNTIME === 'edge' ) {
1313 throw new InvariantError (
@@ -26,7 +26,8 @@ export function prerenderAndAbortInSequentialTasks<R>(
2626 } )
2727 setImmediate ( ( ) => {
2828 abort ( )
29- resolve ( pendingResult )
29+ . then ( ( ) => resolve ( pendingResult ) )
30+ . catch ( ( ) => { } )
3031 } )
3132 } )
3233 }
Original file line number Diff line number Diff line change @@ -2720,7 +2720,7 @@ async function prerenderToStream(
27202720 implicitTags : implicitTags ,
27212721 renderSignal : initialClientController . signal ,
27222722 controller : initialClientController ,
2723- cacheSignal : null ,
2723+ cacheSignal,
27242724 dynamicTracking : null ,
27252725 revalidate : INFINITE_CACHE ,
27262726 expire : INFINITE_CACHE ,
@@ -2773,7 +2773,8 @@ async function prerenderToStream(
27732773 : [ bootstrapScript ] ,
27742774 }
27752775 ) ,
2776- ( ) => {
2776+ async ( ) => {
2777+ await cacheSignal . cacheReady ( )
27772778 initialClientController . abort ( )
27782779 }
27792780 ) . catch ( ( err ) => {
@@ -2845,7 +2846,7 @@ async function prerenderToStream(
28452846 prerenderIsPending = false
28462847 return prerenderResult
28472848 } ,
2848- ( ) => {
2849+ async ( ) => {
28492850 if ( finalServerController . signal . aborted ) {
28502851 // If the server controller is already aborted we must have called something
28512852 // that required aborting the prerender synchronously such as with new Date()
@@ -2939,7 +2940,7 @@ async function prerenderToStream(
29392940 : [ bootstrapScript ] ,
29402941 }
29412942 ) ,
2942- ( ) => {
2943+ async ( ) => {
29432944 finalClientController . abort ( )
29442945 }
29452946 )
You can’t perform that action at this time.
0 commit comments