Merge pull request #13932 from webpack/bugfix/infinite-loop

fix hmr check returning empty array
This commit is contained in:
Tobias Koppers 2021-08-06 10:19:02 +02:00 committed by GitHub
commit a6e9f59dfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 4 deletions

View File

@ -13,7 +13,7 @@ if (module.hot) {
module.hot
.check()
.then(function (updatedModules) {
if (!updatedModules || updatedModules.length === 0) {
if (!updatedModules) {
log("warning", "[HMR] Cannot find update. Need to do a full reload!");
log(
"warning",

View File

@ -12,7 +12,7 @@ if (module.hot) {
module.hot
.check(true)
.then(function (updatedModules) {
if (!updatedModules || updatedModules.length === 0) {
if (!updatedModules) {
if (fromUpdate) log("info", "[HMR] Update applied.");
return;
}

View File

@ -9,7 +9,7 @@ if (module.hot) {
module.hot
.check()
.then(function (updatedModules) {
if (!updatedModules || updatedModules.length === 0) {
if (!updatedModules) {
if (fromUpdate) log("info", "[HMR] Update applied.");
else log("warning", "[HMR] Cannot find update.");
return;

View File

@ -252,7 +252,11 @@ module.exports = function () {
.then($hmrDownloadManifest$)
.then(function (update) {
if (!update) {
return setStatus(applyInvalidatedModules() ? "ready" : "idle");
return setStatus(applyInvalidatedModules() ? "ready" : "idle").then(
function () {
return null;
}
);
}
return setStatus("prepare").then(function () {