Skip to content

Commit

Permalink
sorry
Browse files Browse the repository at this point in the history
  • Loading branch information
feedthejim authored and unstubbable committed Aug 6, 2024
1 parent 3c04e6f commit 2bcc533
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/next/src/server/lib/patch-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ type PatchedFetcher = Fetcher & {
readonly _nextOriginalFetch: Fetcher
}

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

function isFetchPatched() {
// @ts-ignore
return globalThis[nextPatchSymbol] === true
return globalThis[NEXT_PATCH_SYMBOL] === true
}

export function validateRevalidate(
Expand Down Expand Up @@ -796,7 +796,7 @@ function createPatchedFetcher(
patched.__nextGetStaticStore = () => staticGenerationAsyncStorage
patched._nextOriginalFetch = originFetch
// @ts-ignore
globalThis[nextPatchSymbol] = true
globalThis[NEXT_PATCH_SYMBOL] = true

return patched
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ import { normalizeMetadataPageToRoute } from '../../../lib/metadata/get-metadata
import { createEnvDefinitions } from '../experimental/create-env-definitions'
import { JsConfigPathsPlugin } from '../../../build/webpack/plugins/jsconfig-paths-plugin'
import { store as consoleStore } from '../../../build/output/store'
import { NEXT_PATCH_SYMBOL } from '../patch-fetch'

export type SetupOpts = {
renderServer: LazyRenderServerInstance
Expand Down Expand Up @@ -185,6 +186,8 @@ async function startWatcher(opts: SetupOpts) {
const originalFetch = global.fetch
const resetFetch = () => {
global.fetch = originalFetch
// @ts-ignore
global[NEXT_PATCH_SYMBOL] = false
}

const hotReloader: NextJsHotReloaderInterface = opts.turbo
Expand Down

0 comments on commit 2bcc533

Please sign in to comment.