Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/gatsby
SDK Version
7.16.0
Framework Version
React 17.0.2
Link to Sentry event
No response
Steps to Reproduce
We switched from the latest version of @sentry/browser to @sentry/gatsby and got the following error:
Error in function eval in ./node_modules/@sentry/utils/esm/instrument.js:134

We didn't change any configuration, we only switched from Sentry SDK (@sentry/browser to @sentry/gatsby).
We use the following Sentry dependencies:
{
"@sentry/gatsby": "^7.16.0",
"@sentry/integrations": "^7.16.0",
"@sentry/tracing": "^7.16.0",
"@sentry/types": "^7.16.0",
}This is how our gatsby-browser.js file looks:
import{init}from'@sentry/gatsby';import{BrowserTracing}from'@sentry/tracing';import{Dedupe,ExtraErrorData}from'@sentry/integrations';/** * Called when the Gatsby browser runtime first starts. */exportconstonClientEntry=async()=>{/** * Available Options: https://docs.sentry.io/error-reporting/configuration/?platform=browser */init({dsn: process.env.GATSBY_SENTRY_DSN,release: __DYNAMIC_RELEASE_STRING__,// eslint-disable-lineenvironment: process.env.GATSBY_ACTIVE_ENV,debug: process.env.GATSBY_SENTRY_DEBUG_MODE==='true',maxBreadcrumbs: 50,autoSessionTracking: true,// You can log events to Sentry, even locally in development env, but you need to opt-in for it.enabled: process.env.GATSBY_ACTIVE_ENV==='production'||process.env.GATSBY_SENTRY_DEBUG_MODE==='true',normalizeDepth: 6,integrations: [newDedupe(),newExtraErrorData(),// This enables automatic instrumentation (highly recommended), but is not// necessary for purely manual usagenewBrowserTracing({tracingOrigins: ['localhost','domain-a.nl','domain-b.be',/^\//],}),],ignoreErrors: ['ResizeObserver loop limit exceeded','CookieControl',// CookieBot related errors'webkitPresentationMode','iFrameResizer','iframe-resizer-react','ChunkLoadError','Pastease',],denyUrls: [/accutics\.net/,/cookiebot\.com/,/doubeclick\.net/,/facebook\.net/,/google\.com/,/google-analytics\.com/,/googleadservices\.com/,/hotjar\.com/,/mopinion\.com/,/omappapi\.com/,/opmnstr\.com/,/zdassets\.com/,/zendesk\.com/,/zopim\.com/,/cdn\.optimizely\.com/,],beforeSend: (event)=>{if(['production','staging'].includes(process.env.GATSBY_ACTIVE_ENV)){// Debug messages will be shown for staging and production only// if GATSBY_SENTRY_DEBUG_MODE env var set to 'true'.// Fatal, error, warning and info messages will always be shown.returnevent.level!=='debug'||process.env.GATSBY_SENTRY_DEBUG_MODE==='true' ? event : null;}returnnull;},beforeBreadcrumb: (breadcrumb)=>{// All related to Hot Module Reloading locally, so no need to have it.if(breadcrumb.category==='xhr'&&breadcrumb.data&&/socket.io\/\?EIO/.test(breadcrumb.data.url)){returnnull;}if(breadcrumb.category==='console'&&/\[HMR\]/.test(breadcrumb.message)){returnnull;}returnbreadcrumb;},// Stacktrace is always attached during errors.// If you want to see it also for debug, warning and info messages, set the GATSBY_SENTRY_DEBUG_MODE to 'true'attachStacktrace: process.env.GATSBY_SENTRY_DEBUG_MODE==='true',// Set tracesSampleRate to 1.0 to capture 100%// of transactions for performance monitoring.// We recommend adjusting this value in productiontracesSampleRate: 0.02,});};Expected Result
The integration has always worked properly with the package @sentry/browser, but after switching to @sentry/gatsby we get the following error message.
Actual Result
We switched from the latest version of @sentry/browser to @sentry/gatsby and got the following error:

Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/gatsby
SDK Version
7.16.0
Framework Version
React 17.0.2
Link to Sentry event
No response
Steps to Reproduce
We switched from the latest version of @sentry/browser to @sentry/gatsby and got the following error:
Error in function eval in ./node_modules/@sentry/utils/esm/instrument.js:134We didn't change any configuration, we only switched from Sentry SDK (@sentry/browser to @sentry/gatsby).
We use the following Sentry dependencies:
{ "@sentry/gatsby": "^7.16.0", "@sentry/integrations": "^7.16.0", "@sentry/tracing": "^7.16.0", "@sentry/types": "^7.16.0", }This is how our gatsby-browser.js file looks:
Expected Result
The integration has always worked properly with the package @sentry/browser, but after switching to @sentry/gatsby we get the following error message.
Actual Result
We switched from the latest version of @sentry/browser to @sentry/gatsby and got the following error: