File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
packages/next-on-pages/templates/_worker.js/utils Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @cloudflare/next-on-pages ' : patch
3
+ ---
4
+
5
+ Fix hanging promise caused by fetch patch symbol
Original file line number Diff line number Diff line change @@ -5,13 +5,13 @@ import { handleSuspenseCacheRequest } from './cache';
5
5
* to work
6
6
*/
7
7
export function patchFetch ( ) : void {
8
- const alreadyPatched = ( globalThis . fetch as Fetch ) [ patchFlagSymbol ] ;
8
+ const alreadyPatched = ( globalThis as GlobalWithPatchSymbol ) [ patchFlagSymbol ] ;
9
9
10
10
if ( alreadyPatched ) return ;
11
11
12
12
applyPatch ( ) ;
13
13
14
- ( globalThis . fetch as Fetch ) [ patchFlagSymbol ] = true ;
14
+ ( globalThis as GlobalWithPatchSymbol ) [ patchFlagSymbol ] = true ;
15
15
}
16
16
17
17
function applyPatch ( ) {
@@ -117,4 +117,4 @@ function setRequestUserAgentIfNeeded(
117
117
118
118
const patchFlagSymbol = Symbol . for ( 'next-on-pages fetch patch' ) ;
119
119
120
- type Fetch = typeof globalThis . fetch & { [ patchFlagSymbol ] : boolean } ;
120
+ type GlobalWithPatchSymbol = typeof globalThis & { [ patchFlagSymbol ] : boolean } ;
You can’t perform that action at this time.
0 commit comments