Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes the sentry bug #3

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ const SentryWebpackPluginOptions = {
// recommended:
// release, url, org, project, authToken, configFile, stripPrefix,
// urlPrefix, include, ignore

org: 'gsu-protocol',
project: 'governance',
url: 'https://sentry.io/',
silent: true // Suppresses all logs
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options.
Expand Down
15 changes: 15 additions & 0 deletions sentry.base.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import getConfig from 'next/config';

const SENTRY_DSN: string =
process.env.SENTRY_DSN ||
'https://[email protected]/4504004886986752';

export const sentryBaseConfig = {
dsn: SENTRY_DSN,
tracesSampleRate: 1.0,
environment: process.env.NEXT_PUBLIC_SENTRY_ENV,
// release is also used for source map uploads at build time,
// so ensure that SENTRY_RELEASE is the same at build time.
release: process.env.SENTRY_RELEASE || getConfig()?.publicRuntimeConfig?.sentryRelease,
enabled: process.env.NEXT_PUBLIC_SENTRY_ENV !== 'development'
};
20 changes: 2 additions & 18 deletions sentry.client.config.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
// This file configures the initialization of Sentry on the browser.
// The config you add here will be used whenever a page is visited.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from '@sentry/nextjs';

const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;
import { sentryBaseConfig } from './sentry.base.config';

Sentry.init({
dsn:
process.env.NODE_ENV === 'production'
? SENTRY_DSN
: null,
// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 1.0,
integrations: [new Sentry.Integrations.Breadcrumbs({ console: false })]
// ...
// Note: if you want to override the automatic release value, do not set a
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
// that it will also get attached to your source maps
});
Sentry.init(sentryBaseConfig);
4 changes: 0 additions & 4 deletions sentry.properties

This file was deleted.

19 changes: 2 additions & 17 deletions sentry.server.config.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
// This file configures the initialization of Sentry on the server.
// The config you add here will be used whenever the server handles a request.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as Sentry from '@sentry/nextjs';

const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;
import { sentryBaseConfig } from './sentry.base.config';

Sentry.init({
dsn:
process.env.NODE_ENV === 'production'
? SENTRY_DSN
: null,
// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 1.0
// ...
// Note: if you want to override the automatic release value, do not set a
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
// that it will also get attached to your source maps
});
Sentry.init(sentryBaseConfig);