Skip to content

Sentry.sentryHandleError failed to normalize Remix request on Node v22 #12472

Closed
@clovis1122

Description

@clovis1122

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

8.9.1

Framework Version

Remix 2.9.2

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

Throw an error inside a loader function.

Expected Result

Sentry log the error with request information

Actual Result

Sentry shows "failed to normalize Remix request on Node". No error is logged (this bit I'm not sure why).

Adding some logs on Sentry, I see the following:

TypeError: Cannot read properties of undefined (reading 'depth')
    at [nodejs.util.inspect.custom] (node:internal/deps/undici/undici:3398:9)
    at Object.normalizeRemixRequest (/workspace/remix/node_modules/@sentry/remix/cjs/utils/web-fetch.js:132:63)
    at captureRemixServerException (/workspace/remix/node_modules/@sentry/remix/cjs/utils/instrumentServer.js:121:34)

The issue seems to be this code:

headers: headers[Symbol.for('nodejs.util.inspect.custom')](),

This is all pretty similar to the issue I reported a while back. I feel like the current solution may break anytime the internals change. It doesn't have to. Node v22 will be LTS in 4 months, and Remix v2 already has a flag to use node's fetch implementation on the server instead of web fetch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: remixIssues related to the Sentry Remix SDK

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions