Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1a5630e

Browse files
committedJul 19, 2024··
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 277a9c0 commit 1a5630e

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)
Please sign in to comment.