Skip to content

Some functions are not available in @sentry/remix #10384

Closed

Description

@jansedlon

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

7.98.0

Framework Version

2.5.1

Link to Sentry event

No response

SDK Setup

entry.server.tsx

Sentry.init({
    dsn: ENV.SENTRY_DSN,
    tracesSampleRate: env.APP_ENV === "production" ? 0.5 : 0.1,
    environment: env.SENTRY_ENVIRONMENT,
    denyUrls: [
      /\/resources\/healthcheck/,
      /\/build\//,
      /\/favicons\//,
      /\/images\//,
      /\/fonts\//,
      /\/favicon.ico/,
      /\/site\.webmanifest/,
      /.*\.map$/,
    ],
    maxValueLength: 5000,
    integrations: [
      new Sentry.Integrations.Http({ tracing: true }),
      new Sentry.Integrations.Prisma({ client: prisma }),
      new ProfilingIntegration(),
      new Sentry.Integrations.RequestData(),
    ],
    beforeSendTransaction(event) {
      if (event.request?.url?.includes("/healthcheck")) return null;

      return event;
    },
  });

entry.client.tsx

Sentry.init({
    dsn: ENV.SENTRY_DSN,
    environment: ENV.SENTRY_ENVIRONMENT,
    integrations: [
      new Sentry.BrowserTracing({
        routingInstrumentation: Sentry.remixRouterInstrumentation(
          useEffect,
          useLocation,
          useMatches,
        ),
      }),
      Sentry.replayIntegration(),
      new Sentry.BrowserProfilingIntegration(),
      new Sentry.BrowserTracing(),
      captureConsoleIntegration({ levels: ["error"] }),
    ],
    // Set tracesSampleRate to 1.0 to capture 100%
    // of transactions for performance monitoring.
    // We recommend adjusting this value in production
    tracesSampleRate: ENV.APP_ENV === "production" ? 0.5 : 0.1,

    // Capture Replay for 10% of all sessions,
    // plus for 100% of sessions with an error
    replaysSessionSampleRate: 0.1,
    replaysOnErrorSampleRate: 1.0,
  });

Steps to Reproduce

  1. Start with Remix boilerplate with custom express server
  2. Import functions like Sentry.getCurrentScope() or Sentry.continueTrace()

Expected Result

The functions should be available and work

Actual Result

Functions are imported, typechecker is happy but when the functions are actually called, it throws an error because it's undefined.

There might be more functions like these, these are the only ones I found.

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 2on Jan 29, 2024
  2. jansedlon commented on Jan 29, 2024

    @jansedlon
    Author

    New findings

    import * as Sentry from "@sentry/remix";
    
    console.log(Sentry.continueTrace) // Is undefined
    console.log(Sentry.default.continueTrace) // This one works
    
    console.log((await import("@sentry/remix")).continueTrace); // is undefined
    console.log((await import("@sentry/remix")).default.continueTrace); // This one is defined
  3. Lms24 commented on Jan 29, 2024

    @Lms24
    Member

    Hi @jansedlon thanks for reporting! Looks like we missed exporting these rather new functions in the Remix SDK correctly.
    Will fix this today. Expect the fix to be released throughout this week.

    If you need an immediate workaround, you can import these functions directly from @sentry/node until we correctly re-export them from the Remix SDK.

  4. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 2on Jan 29, 2024
  5. self-assigned this
    on Jan 29, 2024
  6. Lms24 commented on Jan 29, 2024

    @Lms24
    Member

    Turns out it was quite a few missing exports. More details in #10385.

    We'll make sure this goes out soon, probably even today.

  7. jansedlon commented on Jan 29, 2024

    @jansedlon
    Author

    @Lms24 Thank you 🙏

  8. 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