Skip to content

Maximum call stack size exceeded after upgrading 7.114.0 -> 8.27.0 #13519

Closed as not planned

Description

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

8.27.0

Framework Version

React 18.3, Next.js 14.1.4

Link to Sentry event

https://go-city.sentry.io/issues/5767473230

Reproduction Example/SDK Setup

// sentry.client.ts

Sentry.init({
  enabled: isProduction && isSupportedBrowser,
  dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
  environment: process.env.NEXT_PUBLIC_ENVIRONMENT ?? "local",
  release: isProduction ? process.env.SENTRY_RELEASE : `development-${process.env.USER}`,
  ignoreErrors: ["jQuery"],
  replaysSessionSampleRate: parseFloat(process.env.NEXT_PUBLIC_SENTRY_REPLAY_SESSION_SAMPLE_RATE ?? "0.0"),
  replaysOnErrorSampleRate: 1,
  allowUrls: isProduction
    ? [
        // Match the sites and GTM errors only
        /localhost/,
        /gocity/,
        /londonpass/,
        /parispass/,
        /newyorkpass/,
        /romeandvaticanpass/,
        /gtm.js/,
      ]
    : [],
  integrations: [
    // HttpClient to capture any "Failed to fetch" errors
    Sentry.httpClientIntegration(),
    // Sentry Replay to set up session recording
    Sentry.replayIntegration({
      maskAllText: false,
    }),
  ],
});

// instrumentation.node.ts and instrumentation.edge.ts

Sentry.init({
  enabled: isProduction,
  dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
  environment: process.env.NEXT_PUBLIC_ENVIRONMENT ?? "local",
  release: isProduction ? process.env.SENTRY_RELEASE : `development-${process.env.USER}`,
});

// instrumentation.ts

export async function register() {
  if (process.env.NEXT_RUNTIME === "nodejs") {
    await import("@/instrumentation.node");
  }

  if (process.env.NEXT_RUNTIME === "edge") {
    await import("@/instrumentation.edge");
  }
}

Steps to Reproduce

We just upgraded from Sentry 7.114.0 to 8.27.0 and have since had a few 'Maximum call stack size exceeded' errors appear in Sentry that trace back to /usr/app/node_modules/.pnpm/@[email protected]/node_modules/@sentry/utils/build/cjs/syncpromise.js and /usr/app/node_modules/.pnpm/@[email protected]/node_modules/@sentry/core/build/cjs/eventProcessors.js in a loop.

To upgrade from 7 to 8 we:

  • Moved out sentry.server.config.ts and sentry.edge.config.ts to Next.js instrumentation.ts (We don't actually use the edge runtime, we are self hosting on Node, but we moved the edge config anyway)
  • Combined our SentryWebpackPluginOptions and UserSentryOptions into a single SentryBuildOptions param for withSentryConfig
  • Replaced out httpClientIntegration and replayIntegration with the functional alternative

Expected Result

We didn't see these issues before but we do now. All events seem to be happening Node, none from the browser.

Actual Result

No new errors 🙏

Activity

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

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    • Status

      Waiting for: Community

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions