Skip to content

@sentry/next.js v 7.23.1 stops sending events #6475

Description

@isaac-martin

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/nextjs

SDK Version

7.23.0

Framework Version

7.23.0

Link to Sentry event

No response

Steps to Reproduce

After upgrading sentry to @sentry/next js to 7.23.1 we no longer get events sent.

this PR i believe is the culprit #6267 and looking at the code and the description that makes sense.

Our configs are below, and im wndering if its something in the ts-node register that is causing next to exclude the withSentryConfig from the bundle.

I also tried with just the sentry plugin and not using the next-compose-plugins and still was not able to send events

next.config.ts looks like the below

importNextBundleAnalyzerfrom"@next/bundle-analyzer";import{withSentryConfig}from"@sentry/nextjs";import{NextConfig}from"next";importwithPluginsfrom"next-compose-plugins";importenvVariablesfrom"@brexhq/shared/utils/env/envVariables";import{isDev}from"@brexhq/shared/utils/env/isDevEnv";import{ensureEnvVariable}from"./src/utils/dataFetching/env";import{getSanityToken}from"./src/utils/dataFetching/fetchFromSanity";constnextConfig: NextConfig={reactStrictMode: true,experimental: {externalDir: true,},sentry: {hideSourceMaps: true,},env: {
...
},asyncheaders(){return[...],},];},asyncrewrites(){return[...];},};constsentryWebpackPluginOptions={silent: true,};constbundleAnalyzer=process.env.ANALYZE
? NextBundleAnalyzer({enabled: process.env.ANALYZE==="true",})
: (config: any)=>config;constsentry=withSentryConfig(nextConfigasany,sentryWebpackPluginOptions);constimages={images: {remotePatterns: [{protocol: "https",hostname: "brand.brex.com",pathname: "/**",port: "",},],},};module.exports=withPlugins([sentry,bundleAnalyzer,images]);

next.config.js is this which compiles the next.config.ts

require("ts-node").register({compilerOptions: {module: "commonjs",target: "es2017",},});require("tsconfig-paths/register");module.exports=require("./next.config.ts");

Expected Result

Sentry sends events

Actual Result

No events are sent via sentry, and I observe no network calls being made.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions