Skip to content

Risk of wrongly spreading a string in captureRemixErrorBoundaryError #9279

@hanayashiki

Description

@hanayashiki

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/remix

SDK Version

7.74.0

Framework Version

React 18.2.0

Link to Sentry event

https://monoid.sentry.io/issues/4545141368/events/1285f64c9bfb4e41af32e5447693ef81/?project=4506041272500224&query=is%3Aunresolved&referrer=next-event&statsPeriod=14d&stream_index=0

SDK Setup

No response

Steps to Reproduce

  1. Capture the error returned by useRouteError
export function ErrorBoundary() {
  const error = useRouteError();

  captureRemixErrorBoundaryError(error);
}
  1. Trigger a remix 404 error:
No routes matched location "/daw/" 
  1. The error tags look like a wrongly spreaded string:
image

Expected Result

The error message is displayed normally.

Actual Result

The error message is displayed like a spreaded string.

The root cause seems to be here:

When the event.data is a string, it will be spreaded into eventData as something like { 0: 'a', 1: 'b', 2: 'c' ... }, which scrambles the display of error data on the page.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions