Skip to content

Commit

Permalink
protect window reference in hmr client
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed Dec 13, 2020
1 parent d4292d7 commit ad69063
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion snowpack/assets/hmr-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ socket.addEventListener('message', ({data: _data}) => {
log('listening for file changes...');

/** Runtime error reporting: If a runtime error occurs, show it in an overlay. */
window && window.addEventListener('error', function (event) {
isWindowDefined && window.addEventListener('error', function (event) {
// Generate an "error location" string
let fileLoc;
if (event.filename) {
Expand Down

1 comment on commit ad69063

@vercel
Copy link

@vercel vercel bot commented on ad69063 Dec 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.