Skip to content

Commit

Permalink
Revert "Work around existing bugs"
Browse files Browse the repository at this point in the history
There's really no right amount of time to wait for the HMR update. Need to fix the bug
  • Loading branch information
eps1lon committed Jul 19, 2024
1 parent e1b3c7d commit 3a992fe
Showing 1 changed file with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,19 +193,7 @@ export async function fetchServerResponse(
isNavigation &&
!process.env.TURBOPACK
) {
const webpackHMRTimedOut = await Promise.race([
waitForWebpackRuntimeHotUpdate().then(() => false),
new Promise((resolve) => setTimeout(() => resolve(true), 2000)),
])

// Work around existing bugs where we receive an HMR update but no message that it was finished.
// Having the log before an MPA is pretty bad since it'll just flash the page and then navigate.
if (webpackHMRTimedOut) {
console.error(
'Webpack runtime hot update timed out. Falling back to browser navigation.'
)
return doMpaNavigation(responseUrl.toString())
}
await waitForWebpackRuntimeHotUpdate()
}

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

0 comments on commit 3a992fe

Please sign in to comment.