Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(sntry): sentry client error report
  • Loading branch information
Aslam97 committed Sep 11, 2024
commit 8d2cf9e676f72479a74a8745c8d5e56ac10e145d
6 changes: 4 additions & 2 deletions web/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ NEXT_PUBLIC_JAZZ_PEER_URL="wss://"

RONIN_TOKEN=

SENTRY_DSN=
SENTRY_PROJECT=
NEXT_PUBLIC_SENTRY_DSN=
NEXT_PUBLIC_SENTRY_ORG=
NEXT_PUBLIC_SENTRY_PROJECT=

# IGNORE_BUILD_ERRORS=true
9 changes: 0 additions & 9 deletions web/app/api/sentry-example-api/route.ts

This file was deleted.

79 changes: 0 additions & 79 deletions web/app/sentry-example-page/page.tsx

This file was deleted.

4 changes: 4 additions & 0 deletions web/instrumentation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import * as Sentry from "@sentry/nextjs"

export async function register() {
if (process.env.NEXT_RUNTIME === "nodejs") {
await import("./sentry.server.config")
}
}

export const onRequestError = Sentry.captureRequestError
7 changes: 3 additions & 4 deletions web/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ export default withSentryConfig(nextConfig, {
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

org: "learn-anything",
project: process.env.SENTRY_PROJECT,
sentryUrl: "https://sentry.io/",
org: process.env.NEXT_PUBLIC_SENTRY_ORG,
project: process.env.NEXT_PUBLIC_SENTRY_PROJECT,

// Only print logs for uploading source maps in CI
silent: !process.env.CI,
Expand All @@ -64,7 +63,7 @@ export default withSentryConfig(nextConfig, {
enabled: true
},

// Uncomment to route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
// This can increase your server load as well as your hosting bill.
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
// side errors will fail.
Expand Down
4 changes: 2 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@radix-ui/react-toggle": "^1.1.0",
"@radix-ui/react-toggle-group": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.2",
"@sentry/nextjs": "^8.29.0",
"@sentry/nextjs": "^8.30.0",
"@tanstack/react-virtual": "^3.10.7",
"@tiptap/core": "^2.6.6",
"@tiptap/extension-blockquote": "^2.6.6",
Expand Down Expand Up @@ -105,7 +105,7 @@
"zsa-react": "^0.2.2"
},
"devDependencies": {
"@ronin/learn-anything": "^0.0.0-3451915138150",
"@ronin/learn-anything": "^0.0.0-3451954511456",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.1",
"@types/jest": "^29.5.12",
Expand Down
2 changes: 1 addition & 1 deletion web/sentry.client.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import * as Sentry from "@sentry/nextjs"

Sentry.init({
dsn: process.env.SENTRY_DSN,
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,

// Add optional integrations for additional features
integrations: [Sentry.replayIntegration()],
Expand Down
2 changes: 1 addition & 1 deletion web/sentry.server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import * as Sentry from "@sentry/nextjs"

Sentry.init({
dsn: process.env.SENTRY_DSN,
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,

// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
tracesSampleRate: 1,
Expand Down