Skip to content

Error logs are muted when using wrapRemixHandleError as a handleError function in Remix #11615

Closed

Description

@thomasverleye

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which SDK are you using?

@sentry/remix

SDK Version

7.110.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

Sentry.init({
  dsn: process.env.SENTRY_REMIX_DSN,
  environment: process.env.APP_ENV,
  release: `itsme-b2b-portal-fe@${process.env.APP_VERSION}`,
  tracesSampleRate: Number(process.env.SENTRY_SAMPLE_RATE),
  initialScope: {
    tags: {
      'app.version': process.env.APP_VERSION,
      'portal.version': process.env.B2B_PORTAL_VERSION,
    },
  },
});

Steps to Reproduce

  1. Add export const handleError = Sentry.wrapRemixHandleError to your entry.server.tsx
  2. Throw a random server error (for instance throw new Error('foo'); in a loader function)
  3. Check the terminal console and find no message foo in console.

Expected Result

I expect the node console to log foo

Actual Result

no foo message

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 2on Apr 15, 2024
  2. Lms24 commented on Apr 16, 2024

    @Lms24
    Member

    Hey @thomasverleye thanks for writing in! I'm gonna ask @onurtemizkan to please take a look, thanks!

    General note: Ideally, our SDK just grabs the error and sends it to Sentry. We generally always rethrow/pass down the error so that you can handle it yourself afterwards. In some cases, this a bit tricky or unavoidable slightly modifies the default behaviour (e.g. error message formatting in NodeJS). However, if we can, we should still rethrow the error (however that works for Remix specifically).

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

    @onurtemizkan
    Contributor

    Hey @thomasverleye, thanks for reporting.

    When handleError is used, Remix disables the built-in error logging for the errors that end up inside that utility (Remix Docs) So, this seems like the expected Remix behaviour.

    That said, as @Lms24 mentioned, I also checked the other places we handle / report errors like loader / action / documentRequest, and indeed we seem to be swallowing them. So I'll open a PR to fix that. That will probably fix the issue you have reported (as you're throwing error from the loader). But not all the errors that are handled by wrapRemixHandleError.

  5. ghost added on Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions