Skip to content

Commit 2bcc533

Browse files
feedthejimunstubbable
authored andcommitted
sorry
1 parent 3c04e6f commit 2bcc533

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/next/src/server/lib/patch-fetch.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ type PatchedFetcher = Fetcher & {
3030
readonly _nextOriginalFetch: Fetcher
3131
}
3232

33-
const nextPatchSymbol = Symbol.for('next-patch')
33+
export const NEXT_PATCH_SYMBOL = Symbol.for('next-patch')
3434

3535
function isFetchPatched() {
3636
// @ts-ignore
37-
return globalThis[nextPatchSymbol] === true
37+
return globalThis[NEXT_PATCH_SYMBOL] === true
3838
}
3939

4040
export function validateRevalidate(
@@ -796,7 +796,7 @@ function createPatchedFetcher(
796796
patched.__nextGetStaticStore = () => staticGenerationAsyncStorage
797797
patched._nextOriginalFetch = originFetch
798798
// @ts-ignore
799-
globalThis[nextPatchSymbol] = true
799+
globalThis[NEXT_PATCH_SYMBOL] = true
800800

801801
return patched
802802
}

packages/next/src/server/lib/router-utils/setup-dev-bundler.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ import { normalizeMetadataPageToRoute } from '../../../lib/metadata/get-metadata
8989
import { createEnvDefinitions } from '../experimental/create-env-definitions'
9090
import { JsConfigPathsPlugin } from '../../../build/webpack/plugins/jsconfig-paths-plugin'
9191
import { store as consoleStore } from '../../../build/output/store'
92+
import { NEXT_PATCH_SYMBOL } from '../patch-fetch'
9293

9394
export type SetupOpts = {
9495
renderServer: LazyRenderServerInstance
@@ -185,6 +186,8 @@ async function startWatcher(opts: SetupOpts) {
185186
const originalFetch = global.fetch
186187
const resetFetch = () => {
187188
global.fetch = originalFetch
189+
// @ts-ignore
190+
global[NEXT_PATCH_SYMBOL] = false
188191
}
189192

190193
const hotReloader: NextJsHotReloaderInterface = opts.turbo

0 commit comments

Comments
 (0)