question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Overlay and error boundaries

See original GitHub issue

The overlay is currently hiding components that are meant to caught specific errors (for instance network errors, like 404). While I’ve seen mentioned that error boundaries should be used sparingly anyway, I still find the UX fairly annoying 😕

At the very least, it would be nice if we could manually tag errors as “silences the overlay”, something like:

static getDerivedStateFromError(error: Error) {
  // Would set a symbol on the `error` instance that Overlay
  // would use to detect when to prevent the overlay
  window.preventOverlayOnError(error);
  return {error};
}

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:9
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
SystemParadoxcommented, May 27, 2021

I really think we need a preventOverlay or similar here.

  1. So we can mark errors as handled within react error boundaries
  2. So we can avoid showing the error overlay if the error is handled by a global error handler in the application
1reaction
everscendingcommented, May 4, 2022

Ok… I just discovered that this can be disabled like so:

new ReactRefreshWebpackPlugin({ overlay: false })

This was not apparent on the main NPM package page and is buried here - https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/HEAD/docs/API.md

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling JavaScript errors in React with error boundaries
js have an error overlay component that blocks the UI whenever there is an error, overshadowing your own error boundaries. In create-react-app, ...
Read more >
create react app - Disable error overlay in development mode
We feel the error overlay provides tremendous value over your typical error boundary (source code, click to open, etc). It is also vital...
Read more >
Use react-error-boundary to handle errors in React
Oh, one other thing. Right now, you may notice that you'll experience that error overlay even if the error was handled by your...
Read more >
React Error Boundaries: Complete Guide - Meticulous
(The CodeSandbox might display a development error overlay that only shows in development, you can dismiss it to see the rendering result).
Read more >
react-app-error-boundary - npm
Allows you to turn react-error-overlay in your react-app from a mandatory-thing-you-never-asked-for into a handy-opt-in-feature. Inspired by ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found