Skip to content

Commit

Permalink
fix(fe): fix sentry initialization (#1873)
Browse files Browse the repository at this point in the history
* fix(fe): fix sentry initialization

* refactor(fe): simplify sentry init logic
  • Loading branch information
jimin9038 authored Jul 28, 2024
1 parent fb47948 commit 29908e3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 30 deletions.
15 changes: 15 additions & 0 deletions apps/frontend/instrumentation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as Sentry from '@sentry/nextjs'

export const register = () => {
if (['nodejs', 'edge'].includes(process.env.NEXT_RUNTIME ?? '')) {
Sentry.init({
dsn: 'https://[email protected]/10',

// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 1,

// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false
})
}
}
3 changes: 2 additions & 1 deletion apps/frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
typedRoutes: true
typedRoutes: true,
instrumentationHook: true
},
output: 'standalone',
env: {
Expand Down
15 changes: 0 additions & 15 deletions apps/frontend/sentry.edge.config.ts

This file was deleted.

14 changes: 0 additions & 14 deletions apps/frontend/sentry.server.config.ts

This file was deleted.

0 comments on commit 29908e3

Please sign in to comment.