fix missed hmr events (#30309)
When an compilation happens in the timespan between "page loaded client bundle" and "web socket got initial sync event" it didn't apply the hmr update.
This commit is contained in:
parent
d8e74a8490
commit
520c5a4083
1 changed files with 4 additions and 1 deletions
|
@ -35,6 +35,7 @@ import {
|
|||
import stripAnsi from 'next/dist/compiled/strip-ansi'
|
||||
import { addMessageListener } from './websocket'
|
||||
import formatWebpackMessages from './format-webpack-messages'
|
||||
import Router from 'next/router'
|
||||
|
||||
// This alternative WebpackDevServer combines the functionality of:
|
||||
// https://github.com/webpack/webpack-dev-server/blob/webpack-1/client/index.js
|
||||
|
@ -88,7 +89,9 @@ function clearOutdatedErrors() {
|
|||
function handleSuccess() {
|
||||
clearOutdatedErrors()
|
||||
|
||||
const isHotUpdate = !isFirstCompilation
|
||||
const isHotUpdate =
|
||||
!isFirstCompilation ||
|
||||
(Router.pathname !== '/_error' && isUpdateAvailable())
|
||||
isFirstCompilation = false
|
||||
hasCompileErrors = false
|
||||
|
||||
|
|
Loading…
Reference in a new issue