Skip to content

Commit

Permalink
fix(gatsby-plugin-layout): log uncaught errors in old browsers (#9635)
Browse files Browse the repository at this point in the history
IE11 doesn't show the actual error, just `Error: Uncaugt error thrown` without any stack traces.

There is no way to implement try/catch around this as this module is the first entry point.

Adding an Error Boundary on the Layout component does not work.
  • Loading branch information
birkir authored and pieh committed Nov 4, 2018
1 parent b275f8a commit 099d47e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/gatsby-plugin-layout/src/wrap-page.js
Expand Up @@ -11,6 +11,9 @@ try {
`Please create layout component in that location or specify path to layout component in gatsby-config.js`
)
} else {
// Logging the error for debugging older browsers as there is no way
// to wrap the thrown error in a try/catch.
console.error(e)
throw e
}
}
Expand Down

0 comments on commit 099d47e

Please sign in to comment.