Skip to content

Remix SDK not reporting server errors to Sentry #8216

Closed
@MoSattler

Description

@MoSattler

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

Framework Version

Remix 1.16.1

Link to Sentry event

No response

SDK Setup

// entrypoint.client.ts
Sentry.init({
  debug: true,
  dsn: "XXX",
  integrations: [
    new Sentry.BrowserTracing({
      routingInstrumentation: Sentry.remixRouterInstrumentation(
        useEffect,
        useLocation,
        useMatches
      ),
    }),
    new Sentry.Replay(),
  ],
  // Performance Monitoring
  tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!
  // Session Replay
  replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
  replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
});
// entrypoint.server.ts
Sentry.init({
  debug: true,
  dsn: "XXX",
  integrations: [new Sentry.Integrations.Prisma({ client: prisma })],
  // Performance Monitoring
  tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!
});
// root
function App() {
  return (
    <html lang="en" className="h-full bg-gray-100">
      <head>
        <meta charSet="utf-8" />
        <meta name="viewport" content="width=device-width,initial-scale=1" />
        <Meta />
        <Links />
      </head>
      <body className="h-full">
        <IntlProvider locale={"en"}>
          <Outlet />
        </IntlProvider>
        <ScrollRestoration />
        <Scripts />
        <LiveReload />
      </body>
    </html>
  );
}

export default withSentry(App);

Steps to Reproduce

  1. Clone this repo
  2. Remove try catch here so you get the equivalent of the docs here:
export const action: ActionFunction = async ({ request }) => {
  throw new Error("Sentry Error");
};
  1. trigger action

When turning on debug, it will also give out

Sentry Logger [warn]: Remix SDK was unable to wrap your root because of one or more missing parameters.

Expected Result

Unhandled error that breaks actions or loaders should be reported to sentry

Actual Result

Nothing is reported to sentry

Metadata

Metadata

Assignees

Labels

Package: remixIssues related to the Sentry Remix SDK

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions