This example reproduces a bug where the isUnloading flag gets stuck after canceling the "Leave site?" dialog, blocking Live Reload updates.
When a user cancels the native confirmation dialog triggered by a beforeunload event listener, webpack-dev-server's internal isUnloading state remains true. This causes all subsequent Live Reload updates to be ignored until manual refresh.
module.exports = {
devServer: {
hot: false,
liveReload: true, // Test Live Reload scenario
},
};- Enable "Slow 3G" in browser DevTools Network tab (to make the issue more visible)
- Open browser console to see webpack-dev-server logs
- Run
npx webpack serveand openhttp://localhost:8080/ - Click "Add Beforeunload Event" button
- Click "Reload Page" button (or press F5/Ctrl+R)
- When "Leave site?" dialog appears, click "Cancel"
- Edit
app.jsfile (make any change to trigger rebuild) - Bug: Page does not update despite file changes
Expected: After canceling dialog, file changes should still trigger Live Reload updates
Actual: Live Reload updates are completely blocked until manual refresh