Skip to content

Commit

Permalink
chore: disable sentry (#1326)
Browse files Browse the repository at this point in the history
* chore: disable sentry

* chore: disable sentry
  • Loading branch information
Holybasil authored Oct 20, 2024
1 parent ada4661 commit aa72e4a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
12 changes: 6 additions & 6 deletions craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const CracoLessPlugin = require("craco-less")
const webpack = require("webpack")
const path = require("path")
const MiniCssExtractPlugin = require("mini-css-extract-plugin")
const SentryWebpackPlugin = require("@sentry/webpack-plugin")
// const SentryWebpackPlugin = require("@sentry/webpack-plugin")
require("./scripts/download-blog-posts.data.json.js")

module.exports = {
Expand Down Expand Up @@ -85,11 +85,11 @@ module.exports = {
})

if (env === "production" && process.env.CI) {
const sentryPlugin = new SentryWebpackPlugin({
include: "./build",
release: process.env.REACT_APP_VERSION,
})
webpackConfig.plugins.push(sentryPlugin)
// const sentryPlugin = new SentryWebpackPlugin({
// include: "./build",
// release: process.env.REACT_APP_VERSION,
// })
// webpackConfig.plugins.push(sentryPlugin)

const instanceOfMiniCssExtractPlugin = webpackConfig.plugins.find(plugin => plugin instanceof MiniCssExtractPlugin)
instanceOfMiniCssExtractPlugin.options.ignoreOrder = true
Expand Down
46 changes: 23 additions & 23 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Sentry from "@sentry/react"
// import * as Sentry from "@sentry/react"
import { isMobile } from "react-device-detect"
import ReactDOM from "react-dom/client"
import ReactGA from "react-ga4"
Expand All @@ -25,28 +25,28 @@ window.addEventListener("unhandledrejection", function (event) {
})

if (requireEnv("NODE_ENV") === "production") {
Sentry.init({
environment: requireEnv("REACT_APP_SCROLL_ENVIRONMENT"),
dsn: requireEnv("REACT_APP_SENTRY_DSN"),
autoSessionTracking: false,
integrations: [
new Sentry.Integrations.Breadcrumbs({
console: false,
dom: false,
fetch: false,
history: false,
sentry: false,
xhr: false,
}),
],
tracesSampleRate: 1.0,
beforeSend(event) {
if (!event.exception) {
return null
}
return event
},
})
// Sentry.init({
// environment: requireEnv("REACT_APP_SCROLL_ENVIRONMENT"),
// dsn: requireEnv("REACT_APP_SENTRY_DSN"),
// autoSessionTracking: false,
// integrations: [
// new Sentry.Integrations.Breadcrumbs({
// console: false,
// dom: false,
// fetch: false,
// history: false,
// sentry: false,
// xhr: false,
// }),
// ],
// tracesSampleRate: 1.0,
// beforeSend(event) {
// if (!event.exception) {
// return null
// }
// return event
// },
// })

const GOOGLE_ANALYTICS_ID: string | undefined = requireEnv("REACT_APP_GOOGLE_ANALYTICS_ID")
if (typeof GOOGLE_ANALYTICS_ID === "string") {
Expand Down

0 comments on commit aa72e4a

Please sign in to comment.