Skip to content

RangeError: Maximum call stack size exceeded in @sentry/remix server instrumentation #16075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
badeleux opened this issue Apr 16, 2025 · 3 comments
Open
3 tasks done
Labels

Comments

@badeleux
Copy link

badeleux commented Apr 16, 2025

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/remix

SDK Version

9.12.0

Framework Version

Remix 2.16.5

Link to Sentry event

No response

Reproduction Example/SDK Setup

import * as Sentry from "@sentry/remix";

const { SENTRY_DSN, ENVIRONMENT, NODE_ENV } = process.env;

if (NODE_ENV === "production") {
	console.info("Initializing Sentry");
	Sentry.init({
		dsn: SENTRY_DSN,
		tracesSampleRate: 0.3,
		profilesSampleRate: 0.1,
		autoInstrumentRemix: true,
		environment: ENVIRONMENT,
		sendDefaultPii: true,
                 integrations: [nodeProfilingIntegration(), Sentry.prismaIntegration()],
		beforeSendTransaction: (transaction) => {
			if (transaction.request?.url.endsWith("js.map")) return null;
			return transaction;
		},
		ignoreTransactions: ["healthcheck"],
	});
}

Environment
Node.js: v20.19.0
Sentry Remix SDK version: 9.12.0
Using ZenStack enhanced Prisma client
Using pnpm package manager

Steps to Reproduce

  1. Set up a Remix application with Sentry integration
  2. Configure Sentry server instrumentation in instrument.server.mjs
  3. Run the application under load or for an extended period
  4. Observe that occasionally the server crashes with the following error:
/myapp/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]__@ope_uinifbjcggxueklhweoo2zo2yi/node_modules/@sentry/remix/build/cjs/server/instrumentServer.js:167
    return async function ( args) {
                          ^
RangeError: Maximum call stack size exceeded

Expected Result

No crash.

Actual Result

Crash.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Apr 16, 2025
@linear linear bot added the Bug label Apr 16, 2025
@lforst
Copy link
Member

lforst commented Apr 16, 2025

Thanks for writing in! Are there any more stack frames shown in the error message? I'd like to understand where we are potentially calling things too deeply.

@badeleux
Copy link
Author

Unfortunately nothing else.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Apr 16, 2025
@lforst
Copy link
Member

lforst commented Apr 16, 2025

That is odd. Can you check that you don't have any addEventProcessor calls in your application or that you are not calling Sentry.init() over and over again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants