Skip to content

Commit 682901f

Browse files
committed
Revert "Work around existing bugs"
There's really no right amount of time to wait for the HMR update. Need to fix the bug
1 parent edb06b2 commit 682901f

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

packages/next/src/client/components/router-reducer/fetch-server-response.ts

+1-13
Original file line numberDiff line numberDiff line change
@@ -193,19 +193,7 @@ export async function fetchServerResponse(
193193
isNavigation &&
194194
!process.env.TURBOPACK
195195
) {
196-
const webpackHMRTimedOut = await Promise.race([
197-
waitForWebpackRuntimeHotUpdate().then(() => false),
198-
new Promise((resolve) => setTimeout(() => resolve(true), 2000)),
199-
])
200-
201-
// Work around existing bugs where we receive an HMR update but no message that it was finished.
202-
// Having the log before an MPA is pretty bad since it'll just flash the page and then navigate.
203-
if (webpackHMRTimedOut) {
204-
console.error(
205-
'Webpack runtime hot update timed out. Falling back to browser navigation.'
206-
)
207-
return doMpaNavigation(responseUrl.toString())
208-
}
196+
await waitForWebpackRuntimeHotUpdate()
209197
}
210198

211199
// Handle the `fetch` readable stream that can be unwrapped by `React.use`.

0 commit comments

Comments
 (0)