Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #4760
Closed
Open
Issue created Jul 09, 2018 by Administrator@rootContributor

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 StackFrames 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.

Assignee
Assign to
Time tracking