Skip to content

Commit

Permalink
fix: error overlay initialization prior body, fixes #1127
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Dec 18, 2018
1 parent e00bc6f commit 9177aba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/errorReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class ErrorOverlay extends React.Component {
}

const initErrorOverlay = () => {
if (typeof document === 'undefined') {
if (typeof document === 'undefined' || !document.body) {
return
}
let div = document.querySelector('.react-hot-loader-error-overlay')
Expand All @@ -123,8 +123,10 @@ const initErrorOverlay = () => {
}

export const clearExceptions = () => {
lastError = []
initErrorOverlay()
if (lastError.length) {
lastError = []
initErrorOverlay()
}
}

export const logException = (error, errorInfo) => {
Expand Down

0 comments on commit 9177aba

Please sign in to comment.