Skip to content

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

Closed

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.

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jun 12, 2024
  2. Lms24 commented on Jun 13, 2024

    @Lms24
    Member

    Hey @clovis1122 thanks for writing in!

    @onurtemizkan when you have a minute, would you mind taking a look? Any chance this will be fixed/no longer an issue by #12110?

  3. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jun 13, 2024
  4. onurtemizkan commented on Jun 13, 2024

    @onurtemizkan
    Contributor

    Thanks for the issue report @clovis1122.

    @Lms24, looks like #12479 will resolve this. I'll test and review today.

  5. kiliman commented on Jun 13, 2024

    @kiliman
    Contributor

    Yes, my PR will fix this, but realized you're supporting older JS versions, so need to change from Object.fromEntries(). I'll update the PR and add a test case

  6. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jun 13, 2024
  7. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions