Skip to content

@sentry/remix exports ErrorBoundary in its types but it is only present in the browser, not in node #16298

Closed
@tmcw

Description

@tmcw

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

9.18.0

Framework Version

Remix 2.16.5

Link to Sentry event

No response

Reproduction Example/SDK Setup

import { ErrorBoundary } from "@sentry/remix";

Steps to Reproduce

  1. Import and use ErrorBoundary from @sentry/remix
  2. Use remix

Expected Result

The ErrorBoundary component is available in both client and SSR contexts, the same as it was in Sentry 8.x

Actual Result

ErrorBoundary is not exported when you're in a node.js environment because of the different entrypoint, and so you fail in prod without a TypeScript error.

This is a pretty tricky way to handle typescript exports: I would sort of understand if there were entrypoints like @sentry/remix/client and @sentry/remix/node, but given that it's one package you import, the types are kind of "lying" about what's actually available: I write isomorphic code as if ErrorBoundary exists, but it only exists in one environment (the browser) and crashes the other (node).

This change also is, afaict, not mentioned in the 9.x release notes: https://github.com/getsentry/sentry-javascript/releases/tag/9.0.0 or the migration guide: https://docs.sentry.io/platforms/javascript/guides/remix/migration/v8-to-v9/

Activity

moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on May 14, 2025
andreiborza

andreiborza commented on May 15, 2025

@andreiborza
Member

Hi @tmcw, thanks for writing in. We're looking into why the export was removed. Indeed it wasn't called out in the migration to v9 so the removal was probably unintentional.

cc @onurtemizkan

moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on May 15, 2025
added a commit that references this issue on May 20, 2025
760d006
github-actions

github-actions commented on May 20, 2025

@github-actions
Contributor

A PR closing this issue has just been released 🚀

This issue was referenced by PR #16341, which was included in the 9.21.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

    Participants

    @tmcw@onurtemizkan@andreiborza

    Issue actions

      @sentry/remix exports ErrorBoundary in its types but it is only present in the browser, not in node · Issue #16298 · getsentry/sentry-javascript