Skip to content

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

Closed
@jansedlon

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.

Metadata

Metadata

Assignees

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