Skip to content

Commit

Permalink
fix: make a copy of listeners to allow adding/removing listeners with…
Browse files Browse the repository at this point in the history
…in the loop
  • Loading branch information
fwouts committed Jun 2, 2021
1 parent 7a0a305 commit 366bd16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ async function handleMessage(payload: HMRPayload) {
return check
}
}
for (const listener of listeners) {
for (const listener of [...listeners]) {
listener(payload)
}
}
Expand Down

0 comments on commit 366bd16

Please sign in to comment.