diff --git a/app/global-error.jsx b/app/global-error.jsx index 1e0bec88c38c3c..b898c0d61ec588 100644 --- a/app/global-error.jsx +++ b/app/global-error.jsx @@ -3,12 +3,12 @@ import 'prism-sentry/index.css'; import {useEffect} from 'react'; -import * as Sentry from '@sentry/nextjs'; +// import * as Sentry from '@sentry/nextjs'; import Error from 'next/error'; export default function GlobalError({error}) { useEffect(() => { - Sentry.captureException(error); + // Sentry.captureException(error); }, [error]); return ( diff --git a/next.config.js b/next.config.js index 00f62a79b442bd..a3f86eca559268 100644 --- a/next.config.js +++ b/next.config.js @@ -1,7 +1,7 @@ const {redirects} = require('./redirects.js'); const {codecovNextJSWebpackPlugin} = require('@codecov/nextjs-webpack-plugin'); -const {withSentryConfig} = require('@sentry/nextjs'); +// const {withSentryConfig} = require('@sentry/nextjs'); const outputFileTracingExcludes = process.env.NEXT_PUBLIC_DEVELOPER_DOCS ? { @@ -13,6 +13,8 @@ const outputFileTracingExcludes = process.env.NEXT_PUBLIC_DEVELOPER_DOCS './apps/**/*', 'develop-docs/**/*', 'node_modules/@esbuild/darwin-arm64', + '*.png', + '*.gif', ], '/platform-redirect': ['**/*.gif', 'public/mdx-images/**/*', '*.pdf'], '\\[\\[\\.\\.\\.path\\]\\]': [ @@ -33,7 +35,7 @@ if ( } /** @type {import('next').NextConfig} */ -const nextConfig = { +module.exports = { pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'], trailingSlash: true, serverExternalPackages: ['rehype-preset-minify'], @@ -64,43 +66,43 @@ const nextConfig = { }, }; -module.exports = withSentryConfig(nextConfig, { - org: 'sentry', - project: process.env.NEXT_PUBLIC_DEVELOPER_DOCS ? 'develop-docs' : 'docs', +// module.exports = withSentryConfig(nextConfig, { +// org: 'sentry', +// project: process.env.NEXT_PUBLIC_DEVELOPER_DOCS ? 'develop-docs' : 'docs', - // Suppresses source map uploading logs during build - silent: !process.env.CI, +// // Suppresses source map uploading logs during build +// silent: !process.env.CI, - // Upload a larger set of source maps for prettier stack traces (increases build time) - widenClientFileUpload: true, +// // Upload a larger set of source maps for prettier stack traces (increases build time) +// widenClientFileUpload: true, - // Transpiles SDK to be compatible with IE11 (increases bundle size) - transpileClientSDK: true, +// // Transpiles SDK to be compatible with IE11 (increases bundle size) +// transpileClientSDK: true, - // Hides source maps from generated client bundles - hideSourceMaps: true, +// // Hides source maps from generated client bundles +// hideSourceMaps: true, - // Automatically tree-shake Sentry logger statements to reduce bundle size - disableLogger: true, +// // Automatically tree-shake Sentry logger statements to reduce bundle size +// disableLogger: true, - // Enables automatic instrumentation of Vercel Cron Monitors - // See the following for more information: - // https://docs.sentry.io/product/crons/ - // https://vercel.com/docs/cron-jobs - automaticVercelMonitors: true, +// // Enables automatic instrumentation of Vercel Cron Monitors +// // See the following for more information: +// // https://docs.sentry.io/product/crons/ +// // https://vercel.com/docs/cron-jobs +// automaticVercelMonitors: true, - reactComponentAnnotation: { - enabled: true, - }, +// reactComponentAnnotation: { +// enabled: true, +// }, - unstable_sentryWebpackPluginOptions: { - applicationKey: 'sentry-docs', - }, +// unstable_sentryWebpackPluginOptions: { +// applicationKey: 'sentry-docs', +// }, - _experimental: { - thirdPartyOriginStackFrames: true, - }, -}); +// _experimental: { +// thirdPartyOriginStackFrames: true, +// }, +// }); process.on('warning', warning => { if (warning.code === 'DEP0040') { diff --git a/src/components/codeHighlights/codeHighlights.tsx b/src/components/codeHighlights/codeHighlights.tsx index 52303c46bb1844..dfe4d56b6b92a8 100644 --- a/src/components/codeHighlights/codeHighlights.tsx +++ b/src/components/codeHighlights/codeHighlights.tsx @@ -3,8 +3,8 @@ import {Children, cloneElement, ReactElement, useEffect, useRef, useState} from 'react'; import {Check, Clipboard} from 'react-feather'; import styled from '@emotion/styled'; -import * as Sentry from '@sentry/nextjs'; +// import * as Sentry from '@sentry/nextjs'; import {cleanCodeSnippet, useCleanSnippetInClipboard} from '../codeBlock'; type ChildrenItem = ReturnType[number] | React.ReactNode; @@ -103,7 +103,7 @@ export function HighlightBlock({ setCopied(true); setTimeout(() => setCopied(false), 1200); } catch (error) { - Sentry.captureException(error); + // Sentry.captureException(error); setCopied(false); } } diff --git a/src/components/expandable/index.tsx b/src/components/expandable/index.tsx index 3738212f0ba6c3..3ea3d4660895cf 100644 --- a/src/components/expandable/index.tsx +++ b/src/components/expandable/index.tsx @@ -2,8 +2,8 @@ import {ReactNode, useCallback, useEffect, useRef, useState} from 'react'; import {ChevronDownIcon, ChevronRightIcon} from '@radix-ui/react-icons'; -import * as Sentry from '@sentry/nextjs'; +// import * as Sentry from '@sentry/nextjs'; // explicitly not usig CSS modules here // because there's some prerendered content that depends on these exact class names import '../callout/styles.scss'; @@ -106,7 +106,7 @@ export function Expandable({ setCopied(true); setTimeout(() => setCopied(false), 1200); } catch (error) { - Sentry.captureException(error); + // Sentry.captureException(error); setCopied(false); } }, diff --git a/src/components/search/index.tsx b/src/components/search/index.tsx index ee412adaa7826d..542bf37069c147 100644 --- a/src/components/search/index.tsx +++ b/src/components/search/index.tsx @@ -3,7 +3,7 @@ import {Fragment, useCallback, useEffect, useRef, useState} from 'react'; import {ArrowRightIcon} from '@radix-ui/react-icons'; import {Button} from '@radix-ui/themes'; -import {captureException} from '@sentry/nextjs'; +// import {captureException} from '@sentry/nextjs'; import { Hit, Result, @@ -244,7 +244,7 @@ export function Search({ positions: [position + 1], }); } catch (error) { - captureException(error); + // captureException(error); } }, []); diff --git a/src/instrumentation-client.ts b/src/instrumentation-client.ts.old similarity index 100% rename from src/instrumentation-client.ts rename to src/instrumentation-client.ts.old diff --git a/src/instrumentation.ts b/src/instrumentation.ts.andrei similarity index 100% rename from src/instrumentation.ts rename to src/instrumentation.ts.andrei diff --git a/src/pages/_error.jsx b/src/pages/_error.jsx deleted file mode 100644 index cc2bc3771fa30c..00000000000000 --- a/src/pages/_error.jsx +++ /dev/null @@ -1,17 +0,0 @@ -import * as Sentry from '@sentry/nextjs'; -import Error from 'next/error'; - -function CustomErrorComponent(props) { - return ; -} - -CustomErrorComponent.getInitialProps = async contextData => { - // In case this is running in a serverless function, await this in order to give Sentry - // time to send the error before the lambda exits - await Sentry.captureUnderscoreErrorException(contextData); - - // This will contain the status code of the response - return Error.getInitialProps(contextData); -}; - -export default CustomErrorComponent;