Skip to content

Commit

Permalink
fix: hmr request 404 (#531)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom <[email protected]>
  • Loading branch information
wangjinyang and Tom authored May 27, 2023
1 parent 3764e1f commit 67b0b5b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/platform-web/src/shuvi-app/dev/hotDevClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,6 @@ async function tryApplyUpdates(onHotUpdateSuccess) {
}

function handleApplyUpdates(err, updatedModules) {
const hasUpdates = Boolean(updatedModules?.length);

if (hadRuntimeError) {
hadRuntimeError = false;
window.location.reload();
Expand All @@ -347,6 +345,13 @@ async function tryApplyUpdates(onHotUpdateSuccess) {
hadRuntimeError = true;
}

const hasUpdates = Boolean(updatedModules?.length);

if (!hasUpdates) {
window.location.reload();
return;
}

if (typeof onHotUpdateSuccess === 'function') {
// Maybe we want to do something.
onHotUpdateSuccess(hasUpdates);
Expand Down

0 comments on commit 67b0b5b

Please sign in to comment.