Skip to main content
The Sentry Remix SDK provides comprehensive error monitoring and performance tracking for Remix applications with support for both client and server-side rendering.

Installation

Version Compatibility

  • Remix 2.x: Fully supported (Vite & Classic Compiler)
  • React Router 6.4+: Full support
  • Works with all Remix runtimes (Node.js, Cloudflare Workers, Deno)

Basic Setup

Client-Side Configuration

Create or update app/entry.client.tsx:

Server-Side Configuration

Create or update app/entry.server.tsx:

Root Component Wrapper

Wrap your root component in app/root.tsx:

Error Handling

Route Loaders

Route Actions

Component Errors

Performance Monitoring

Custom Transactions

Database Queries

Prisma Integration

Context and User Information

Setting User Context

Server-Side Context

Source Maps

For Remix with Vite, configure in vite.config.ts:
For Classic Remix Compiler, use the CLI:

Environment Variables

Add to your .env file:
Make environment variables available to the client:

Deployment Platforms

Add environment variables in Vercel dashboard:
  • SENTRY_DSN
  • SENTRY_AUTH_TOKEN
  • SENTRY_ORG
  • SENTRY_PROJECT

Best Practices

Wrap Root

Always wrap your root component with withSentry for error tracking.

Handle Errors

Use wrapHandleErrorWithSentry in entry.server.tsx.

User Context

Set user context in loaders after authentication.

Source Maps

Always upload source maps for production builds.

Troubleshooting

Ensure:
  1. Both entry.client.tsx and entry.server.tsx are initialized
  2. Root component is wrapped with withSentry
  3. DSN is correctly configured on both client and server
Verify:
  1. browserTracingIntegration is configured with Remix hooks
  2. tracesSampleRate is set appropriately
  3. React hooks (useEffect, useLocation, useMatches) are passed

Next Steps

Loaders

Track data loading performance

Actions

Monitor form submissions and mutations

Session Replay

Debug with session recordings

Prisma

Integrate database monitoring