Skip to content

Commit c9d5f52

Browse files
authored
Fixed sentry broke the website
1 parent ac1a3d4 commit c9d5f52

2 files changed

Lines changed: 20 additions & 12 deletions

File tree

src/main.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
import React from "react";
22
import { createRoot } from "react-dom/client";
33
import App from "./App";
4-
// import "./sentry";
4+
import * as Sentry from "@sentry/react";
5+
6+
try {
7+
await import("./sentry");
8+
} catch (e) {
9+
console.warn("Sentry failed to load:", e);
10+
}
511

612
const container = document.getElementById("app");
713
if (!container) throw new Error("No root container found");
814

915
const root = createRoot(container);
10-
root.render(<App />);
16+
root.render(<App />);
17+
18+
Sentry.captureException(new Error("Manual test event"));

src/sentry.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import * as Sentry from "@sentry/react";
2-
import { BrowserTracing } from "@sentry/tracing";
3-
import { Replay } from "@sentry/replay";
42

53
Sentry.init({
64
dsn: "https://de284553b9b4c7a3f7bcd9786eb802f2@o4509151884148736.ingest.us.sentry.io/4510040067735557",
7-
release: "aiot@0.2",
8-
environment: "production",
9-
integrations:[
10-
new BrowserTracing(),
11-
new Replay(),
12-
],
5+
integrations: [
6+
Sentry.browserTracingIntegration(),
7+
Sentry.replayIntegration()
8+
],
139
tracesSampleRate: 1.0,
1410
replaysSessionSampleRate: 0.1,
1511
replaysOnErrorSampleRate: 1.0,
16-
enableLogs: true,
17-
});
12+
sendDefaultPii: true,
13+
enableTracing: true
14+
});
15+
16+
// Optional: force a test error at startup
17+
// Sentry.captureException(new Error("Startup test error"));

0 commit comments

Comments
 (0)