|
1 |
| -import { useLocation, useMatches, RemixBrowser } from "@remix-run/react"; |
2 |
| -import { hydrate } from "react-dom"; |
| 1 | +import { RemixBrowser, useLocation, useMatches } from "@remix-run/react"; |
3 | 2 | import * as Sentry from "@sentry/remix";
|
4 | 3 | import { useEffect } from "react";
|
5 |
| -import { HttpClient, Offline } from "@sentry/integrations"; |
| 4 | +import { hydrate } from "react-dom"; |
6 | 5 |
|
7 | 6 | Sentry.init({
|
8 | 7 | dsn: window.ENV.SENTRY_DSN,
|
| 8 | + release: window.ENV.SENTRY_RELEASE, |
| 9 | + environment: "client", |
9 | 10 | integrations: [
|
10 |
| - new Sentry.BrowserTracing({ |
11 |
| - // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled |
12 |
| - // tracePropagationTargets: ["localhost", /^https:\/\/gooey\.ai\/.*/], |
13 |
| - routingInstrumentation: Sentry.remixRouterInstrumentation( |
14 |
| - useEffect, |
15 |
| - useLocation, |
16 |
| - useMatches |
17 |
| - ), |
| 11 | + Sentry.browserTracingIntegration({ |
| 12 | + useEffect, |
| 13 | + useLocation, |
| 14 | + useMatches, |
18 | 15 | }),
|
19 |
| - new Sentry.Replay(), |
20 |
| - new HttpClient(), |
| 16 | + Sentry.replayIntegration(), |
| 17 | + Sentry.httpClientIntegration(), |
21 | 18 | ],
|
22 |
| - release: window.ENV.SENTRY_RELEASE, |
23 | 19 | // Performance Monitoring
|
24 | 20 | tracesSampleRate: 0.005, // Capture X% of the transactions, reduce in production!
|
25 | 21 | // Session Replay
|
26 | 22 | replaysSessionSampleRate: 0, // 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.
|
27 | 23 | replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
|
28 | 24 | // This option is required for capturing headers and cookies.
|
29 | 25 | sendDefaultPii: true,
|
| 26 | + // To enable offline events caching, use makeBrowserOfflineTransport to wrap existing transports and queue events using the browsers' IndexedDB storage. |
| 27 | + // Once your application comes back online, all events will be sent together. |
30 | 28 | transport: Sentry.makeBrowserOfflineTransport(Sentry.makeFetchTransport),
|
| 29 | + // You can use the ignoreErrors option to filter out errors that match a certain pattern. |
| 30 | + ignoreErrors: [ |
| 31 | + /TypeError: Failed to fetch/i, |
| 32 | + /TypeError: Load failed/i, |
| 33 | + /(network)(\s+)(error)/i, |
| 34 | + /AbortError/i, |
| 35 | + ], |
31 | 36 | });
|
32 | 37 |
|
33 | 38 | hydrate(<RemixBrowser />, document);
|
0 commit comments