Closed
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
7.70.0
Framework Version
@sentry/nextjs 7.70.0
Link to Sentry event
No response
SDK Setup
next.config
/** @type {import('next').NextConfig} */
const { withSentryConfig } = require('@sentry/nextjs')
const nextConfig = {
reactStrictMode: true,
serverRuntimeConfig: {
buildEnv: process.env.BUILD_ENV
},
publicRuntimeConfig: {
buildEnv: process.env.BUILD_ENV
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: '**'
}
]
}
}
module.exports = nextConfig
module.exports = withSentryConfig(module.exports, { silent: true })
sentry.client.config.js
import * as Sentry from '@sentry/nextjs'
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN
const SENTRY_ENVIRONMENT = process.env.SENTRY_ENVIRONMENT || process.env.ENVIRONMENT
Sentry.init({
dsn: SENTRY_DSN,
environment: SENTRY_ENVIRONMENT,
tracesSampleRate: 0.1,
debug: false,
replaysOnErrorSampleRate: 0.1,
replaysSessionSampleRate: 0.1,
integrations: [
new Sentry.Replay({
maskAllText: true,
blockAllMedia: true
})
]
})
Steps to Reproduce
- Run
next dev
- Console throws an error (see picture below)
Expected Result
Not to break the build
Actual Result

Some comments:
- This error is fixed with version 7.20.1 the problem is that that version is imcompatible with my current Next version [email protected]
- If I remove withSentryConfig everything works, but there is some problem with withSentryConfig wrapping the NextJS config
Metadata
Metadata
Assignees
Type
Projects
Status
Waiting for: Product Owner