diff --git a/next.config.js b/next.config.js index d49b12b..f0cc8e5 100644 --- a/next.config.js +++ b/next.config.js @@ -20,45 +20,36 @@ const nextConfig = { }, } -module.exports = nextConfig - // SENTRY CONFIG const { withSentryConfig } = require('@sentry/nextjs') -module.exports = withSentryConfig( - module.exports, - { - // For all available options, see: - // https://github.com/getsentry/sentry-webpack-plugin#options +module.exports = withSentryConfig(nextConfig, { + // For all available options, see: + // https://github.com/getsentry/sentry-webpack-plugin#options - // Suppresses source map uploading logs during build - silent: true, - org: process.env.NEXT_PUBLIC_SENTRY_ORG, - project: process.env.NEXT_PUBLIC_SENTRY_PROJECT, - }, - { - // For all available options, see: - // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ + // Suppresses source map uploading logs during build + silent: !process.env.CI, + org: process.env.NEXT_PUBLIC_SENTRY_ORG, + project: process.env.NEXT_PUBLIC_SENTRY_PROJECT, - // 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, - // Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load) - tunnelRoute: '/monitoring', + // Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load) + tunnelRoute: '/monitoring', - // 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, +}) diff --git a/src/utils/token.ts b/src/utils/token.ts index 773b6df..50e45a7 100644 --- a/src/utils/token.ts +++ b/src/utils/token.ts @@ -1,5 +1,5 @@ export const getTokenWithRetry = async ( - maxRetries = 3, + maxRetries = 5, delayMs = 250, ): Promise => { if (typeof document === 'undefined') { @@ -8,6 +8,8 @@ export const getTokenWithRetry = async ( for (let attempt = 0; attempt < maxRetries; attempt++) { const token = new URLSearchParams(document.location?.search).get('token') + console.info(`Attempt ${attempt} to get token: ${token}`) + if (token) { return token }