Skip to content

Best practice for a meaningful componentStack in production? #12757

Description

@morloy

Using Sentry for bug reporting in our production build we often encounter a componentStack like:

    in b
    in li
    in ul
    in v
    in div
    in div
    in i
    in div
    in Unknown
    in t…

Of course, this doesn’t help to locate the problem at all. So I’m wondering, what’s the best practice to get usable information from ErrorBoundaries and the componentStack.
The following options seem to be available:

  • Set mangle: false in uglify (increases bundle size, but works)
  • Set displayName manually for all components (usually not feasible)
  • Use a babel plugin (somehow misses the majority of components for me)
  • Write a tool, that resolves the names using sourcemaps

I’m curious to hear, what most people are using. For me, only the first option works well, but it doesn’t feel like a very elegant solution.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions