Skip to content

Receiving "**non-serializable** (TypeError: Cannot read properties of undefined (reading 'name'))" for an error property #15538

Closed
@patroza

Description

@patroza

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

9.2.0

Framework Version

No response

Link to Sentry event

https://macs-holding.sentry.io/issues/6218488847/events/039f7b826c3d4864bbf132089ea3f611?project=4504671195299840&referrer=alert-rule-issue-list

Reproduction Example/SDK Setup

No response

Steps to Reproduce

Report an error which contains a property that is an object with a custom prototype like Header from effect: https://github.com/Effect-TS/effect/blob/main/packages/platform/src/Headers.ts#L44
Object.getPrototypeOf(Object.create({})) has no constructor

the problem in the SDK is here is a constructor assumed:

return prototype ? prototype.constructor.name : 'null prototype';

In EventBuilder you silently catch errors on that instead

Expected Result

no error inside Contexts cause.defect.response.headers

Actual Result

error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: browserIssues related to the Sentry Browser SDK

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions