-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix hmr updates with rebuilding for build errors (#60676)
### What Sometimes the display of the error overlay is not consistent even when you fixed the error Example: * You have a client page, and you add metadata export, Next.js will error that it's not allowed in client component. * You fix it, but the error overlay is not disappeared. Or you fix it, then introduce it again, then fix it again, the error overlay is still there. ### How We're checking if the HMR webpack hash is changed to decide if we're going to do a hot update in `BUILT` and `SYNC` event, but we update the hash at the very beginning of the event handler. `isUpdateAvailable()` will return `false` in the later calls but the hash has already changed before. So we check if they change before applying hot updates, and then use it later with `isUpdateAvailable()` to determine if necessary to process a new hot update Closes NEXT-2107 --------- Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
- Loading branch information
1 parent
521b0ad
commit dc39448
Showing
2 changed files
with
17 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters