Skip to content
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

Sentry Vite Plugin reactComponentAnnotation causes Javascript Heap OOM #638

Open
mikehuebner opened this issue Dec 11, 2024 · 6 comments
Open

Comments

@mikehuebner
Copy link

mikehuebner commented Dec 11, 2024

Environment

  • @sentry/vite-plugin -> ^2.22.7
  • vite -> 6.0.3
  • node -> 22.0.0

Steps to Reproduce

Build application with the following configuration

export default defineConfig({
  // ...
  plugins: [
    // ...
    sentryVitePlugin({
      org: 'cool-org-name',
      project: 'cooler-project-name',
      release: { name: `cooler-project-name@${Package.version}` },
      silent: true,
      reactComponentAnnotation: {
        enabled: true,
      },
    }),
  ]
});

Expected Result

A normal build, was working fine before the update to 2.22.7 I believe.

Actual Result

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

Things I've Tried

Adding NODE_OPTIONS="--max_old_space_size=8192" - can keep increasing as our runners use --max_old_space_size=10240

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Dec 11, 2024
@mikehuebner mikehuebner changed the title Sentry Vite Plugin reactComponentAnnotation causes Javascript Heap OOO Sentry Vite Plugin reactComponentAnnotation causes Javascript Heap OOM Dec 11, 2024
@AbhiPrasad
Copy link
Member

Hey @mikehuebner thanks for writing in.

A normal build, was working fine before the update to 2.22.7 I believe.

What version were you using before 2.22.7?

Just to confirm, if you set reactComponentAnnotation. to false, you don't get errors anymore?

@mikehuebner
Copy link
Author

mikehuebner commented Dec 11, 2024

Yup, false builds as normal! 2.22.4 was the previous version, along with vite: ^5

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Dec 11, 2024
@lforst
Copy link
Member

lforst commented Dec 12, 2024

Since 2.22.4 we didn't really change anything that might be relevant to this issue. Do you think you would be able to provide a memory profile just so we can narrow down what happens to be consuming so much memory? 10 gigs seems excessive.

@mikehuebner
Copy link
Author

Can do, I'll get that to you later this afternoon.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Dec 12, 2024
@getsantry getsantry bot moved this to Waiting for: Community in GitHub Issues with 👀 3 Dec 13, 2024
@erikian
Copy link

erikian commented Dec 13, 2024

I've been also facing this issue with reactComponentAnnotation. It first started a couple of months ago with @sentry/[email protected], and an update to 2.22.5 solved it for a while, but recently it started failing again. Something between these versions must have improved memory usage (the only thing that catches my eye in the changelog is #598 which landed in 2.22.4), but I assume the issue reappeared as the codebase kept growing and the build started consuming more memory.

For context, I'm using Vite 4 and Node 22.

@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 3 Dec 13, 2024
@lforst
Copy link
Member

lforst commented Dec 13, 2024

I unfortunately have to say this but it is basically impossible for us to investigate and debug OOM issues without consistent repro and/or memory profiles. If anybody could provide those I am happy to take a look!

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

No branches or pull requests

4 participants