Unverified Commit 520c5a40 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

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.
parent d8e74a84
...@@ -35,6 +35,7 @@ import { ...@@ -35,6 +35,7 @@ import {
import stripAnsi from 'next/dist/compiled/strip-ansi' import stripAnsi from 'next/dist/compiled/strip-ansi'
import { addMessageListener } from './websocket' import { addMessageListener } from './websocket'
import formatWebpackMessages from './format-webpack-messages' import formatWebpackMessages from './format-webpack-messages'
import Router from 'next/router'
// This alternative WebpackDevServer combines the functionality of: // This alternative WebpackDevServer combines the functionality of:
// https://github.com/webpack/webpack-dev-server/blob/webpack-1/client/index.js // https://github.com/webpack/webpack-dev-server/blob/webpack-1/client/index.js
...@@ -88,7 +89,9 @@ function clearOutdatedErrors() { ...@@ -88,7 +89,9 @@ function clearOutdatedErrors() {
function handleSuccess() { function handleSuccess() {
clearOutdatedErrors() clearOutdatedErrors()
const isHotUpdate = !isFirstCompilation const isHotUpdate =
!isFirstCompilation ||
(Router.pathname !== '/_error' && isUpdateAvailable())
isFirstCompilation = false isFirstCompilation = false
hasCompileErrors = false hasCompileErrors = false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment