react-error-overlay doesn't show for certain runtime errors
Created by: timneutkens
Context
Hi, I'm currently implementing react-error-overlay in Next.js. So far it's working great, we're even hydrating server-side errors inside react-error-overlay. However, I'm running into one case where the overlay is not shown because none of the stack lines have a source map, in that case, react-error-overlay is not rendered, even though an error happened and there is a message to show (with less accurate details of course).
Is this a bug report?
Maybe, it might be expected, though inconvenient.
Steps to Reproduce
throw new Error('something')
with a stack trace that doesn't have resolvable source maps, for example in Next.js we "rehydrate" errors that happen on the server side by sending them to the client side and then throwing them inside the runtime, this makes sure react-error-overlay catches them.
Expected Behavior
It should show the error overlay even when all StackFrame
s have no _originalFileName
(because react-error-overlay tried fetching the file + source map and it failed to for every stack line).
Specifically, this if statement blocks rendering of the error overlay: https://github.com/facebook/create-react-app/blame/706b319633a59e1e0d58f1bb957e9d30d172f9d8/packages/react-error-overlay/src/utils/getStackFrames.js#L32-L38
Actual Behavior
react-error-overlay is not rendered as it gets blocked by the logic mentioned above, making error handling inconsistent, as it will only show runtime errors that happen when at least 1 stack line has a source map.
Reproducible Demo
I can create one if needed.