-
Notifications
You must be signed in to change notification settings - Fork 40
sentry-vite-plugin cause javascript out of memory #512
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
Comments
Assigning to @getsentry/support for routing ⏲️ |
hey @850036165 - thanks for writing in! Could you add some details about what vite version, vite plugin version, OS type/version you are using? This will help us try to reproduce the issue. If you remove the vite plugin and set |
Thanks AbhiPrasad!
3.with vite plugin on and sourcemap false:dev->success,release uploaded; production:OOM,4.with vite plugin off and sourcemap true:dev->success;production:success,
5.with vite plugin off and sourcemap off: all success |
Seconded, this happens for us, too. Building in BitBucket Pipelines, OOM after setting up
This happens intermittently, some builds work, some builds fail. I already assigned 3072mb RAM to the builder, so something is definitely out of the orderly here. Relevant build loggetsentry/sentry-javascript#15 [builder 6/6] RUN yarn run build:ci --mode staging getsentry/sentry-javascript#15 sha256:8f78e506c2e60740fbfae6d27e45c1b467a10084ea4be13662228a7b648fd026 getsentry/sentry-javascript#15 0.417 yarn run v1.22.19 getsentry/sentry-javascript#15 0.474 $ vite build --mode staging getsentry/sentry-javascript#15 1.170 vite v3.2.7 building for staging... getsentry/sentry-javascript#15 1.225 [sentry-vite-plugin] Info: Sending error and performance telemetry data to Sentry. To disable telemetry, set `options.telemetry` to `false`. getsentry/sentry-javascript#15 1.297 transforming... getsentry/sentry-javascript#15 27.71 ✓ 2026 modules transformed. getsentry/sentry-javascript#15 31.92 rendering chunks... getsentry/sentry-javascript#15 157.2 Killed getsentry/sentry-javascript#15 157.3 error Command failed with exit code 137. getsentry/sentry-javascript#15 157.3 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. getsentry/sentry-javascript#15 ERROR: executor failed running [/bin/sh -c yarn run build:ci --mode $APP_MODE]: exit code: 137 ------ > [builder 6/6] RUN yarn run build:ci --mode staging: ------ executor failed running [/bin/sh -c yarn run build:ci --mode $APP_MODE]: exit code: 137 |
Are you by chance using firebase? We previously received reports about OOM errors occuring in projects that use the |
no, i didn't use this package. |
No Firebase for me either, but maybe it's a shared dependency? |
@850036165 @Radiergummi Yeah, can you try upgrading your dependencies and see if that fixes things? In general the Sentry vite plugin doesn't do anything too computationally expensive I believe. |
I just run into it as well when trying to setup vite plugin using sentry wizzard. sourcemap enabled and
|
I also have this issue, I do however use 'firebase' package but I upgraded/updated it to the latest version and It also runs OOM for me in production, building on my local machine works fine. |
Any updates on this? |
Hi, no concrete updates unfortunately, sorry. Based on all we know, this is caused by other libraries for some reason increasing memory consumption when source maps are generated. We're not entirely sure if and how our plugin could be causing this or what kind of interplay is going on here. Also, the symptoms described in this issue seem to differ. If anyone can provide us a minimal reproduction we'd greatly appreciate it! |
Experiencing the same problem if somebody found a solution... |
@mvarendorff Thanks for the detailed investigation! It indeed seems like an upstream performance issue but it probably didn't help that we were generating a lot of unnecessary mappings. If anybody else is able to share their findings trying out new vite/rollup versions, that would be awesome. |
For our CI it was also fixed by updating @sentry/vite-plugin from 2.16.0 to 2.16.1 |
Okay, I'm gonna go ahead and close this issue. For anybody running into this, it seems like the best solution is to upgrade |
I have |
@Samuelmm1997 Did you manage to solve it? if so, can you share your solution, please? |
@Samuelmm1997 @hmellahi does the issue happen when you generate sourcemaps in general? Or just when you use the Sentry vite plugin? Any kind of reproduction would help us a lot debug further! Thanks for the help |
Hello @AbhiPrasad, thank you for your quick response. I've created an issue about the problem I'm having. Thanks for checking it out! |
I have the latest versions of |
@victorbadila Please try to provide reproduction or a memory profile. Thank you! |
Turns out it was the vite build that was failing with OOM when generating the source maps even if I removed the Sentry plugin from the equation, thus not related to this project. I excluded "node_modules" and everything went fine. |
Same issue with sveltekit...
|
If you experience this issue, please share reproduction or a memory profile. Thank you! If you can't provide any of the two, please prefer thumbs-up over new comments. |
I can’t capture the profile of the failed job on GitLab as the process exits on failing. But here's a profile of a successful build on my local machine using sourcemaps. I'm not sure if it helps. (Generated using Here's another one without sourcemaps: (These profiles can be viewed using https://www.speedscope.app or VS Code) Here are the scripts in my CI file:
If I skip the Orignal issue: #565 |
The same issue with Vite and Nuxt
|
@baharalidurrani Thanks for the cpu profile but I think we need a memory profile instead. |
@EvgeniyGordinskiy try to upgrade vite to the latest version please. Yours is already quite dated. The suspicion right now is that vite generates source maps expensively and there is nothing we can do. |
@lforst I still have it for vite 5.3.3
|
@EvgeniyGordinskiy no that config looks fine. We need someone with this problem to provide a memory profile, otherwise we cannot resolve this issue. |
Actually, let me lock this issue and say the following: Important This issue is locked to avoid people piling on with confusion. We are not dismissing this concern. We have tried but cannot reproduce this issue. If you are able to provide a memory profile of a Vite build that shows excessive memory consumption, please open a new issue and point to this one! |
Message from the maintainers:
Important
This issue is locked to avoid people piling on with confusion. We are not dismissing this concern. We have tried but cannot reproduce this issue. If you are able to provide a memory profile of a Vite build that shows excessive memory consumption, please open a new issue and point to this one!
Environment
SaaS (https://sentry.io/)
Steps to Reproduce
1.configed project using npx @sentry/wizard@latest -i sourcemaps
`import { defineConfig } from "vite";
import { sentryVitePlugin } from "@sentry/vite-plugin";
export default defineConfig({
build: {
sourcemap: true, // Source map generation must be turned on
},
plugins: [
// Put the Sentry vite plugin after all other plugins
sentryVitePlugin({
org: "",
project: "",
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
],
});`
2.run npm run build
3.got error
/usr/local/bin/npm run build
[sentry-vite-plugin] Info: Using environment variables configured in ".env.sentry-build-plugin".
build.terserOptions is specified but build.minify is not set to use Terser. Note Vite now defaults to use esbuild for minification. If you still prefer Terser, set build.minify to "terser".
vite v4.3.9 building for production...
[sentry-vite-plugin] Info: Sending error and performance telemetry data to Sentry. To disable telemetry, set
options.telemetry
tofalse
.transforming (6) src/router/guard/index.tsBrowserslist: caniuse-lite is outdated. Please run:
npx update-browserslist-db@latest
Why you should do it regularly: https://github.com/browserslist/update-db#readme
✓ 4296 modules transformed.
rendering chunks (39)...
<--- Last few GCs --->
[3575:0x158008000] 37526 ms: Mark-Compact 4049.0 (4137.9) -> 4047.4 (4137.9) MB, 836.71 / 0.00 ms (average mu = 0.218, current mu = 0.037) allocation failure; scavenge might not succeed
[3575:0x158008000] 39532 ms: Mark-Compact 4055.3 (4137.9) -> 4054.6 (4167.6) MB, 1995.46 / 0.00 ms (average mu = 0.102, current mu = 0.005) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
1: 0x1028ca114 node::Abort() [/usr/local/bin/node]
2: 0x1028ca2fc node::ModifyCodeGenerationFromStrings(v8::Localv8::Context, v8::Localv8::Value, bool) [/usr/local/bin/node]
3: 0x102a51048 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/usr/local/bin/node]
4: 0x102c2582c v8::internal::Heap::GarbageCollectionReasonToString(v8::internal::GarbageCollectionReason) [/usr/local/bin/node]
5: 0x102c24308 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
6: 0x102c1ab20 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
7: 0x102c1b380 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
8: 0x102c00384 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/local/bin/node]
9: 0x102fe7d94 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
10: 0x103344c44 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/usr/local/bin/node]
11: 0x10901405c
12: 0x109a9123c
13: 0x1088a7ba8
14: 0x109bca03c
15: 0x109b09258
16: 0x108de33cc
17: 0x10879b734
18: 0x1033a0fb8 Builtins_PromiseFulfillReactionJob [/usr/local/bin/node]
19: 0x1032e2b94 Builtins_RunMicrotasks [/usr/local/bin/node]
20: 0x1032ba3f4 Builtins_JSRunMicrotasksEntry [/usr/local/bin/node]
21: 0x102b92c94 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/usr/local/bin/node]
22: 0x102b93180 v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/usr/local/bin/node]
23: 0x102b9335c v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate*, v8::internal::MicrotaskQueue*) [/usr/local/bin/node]
24: 0x102bba418 v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) [/usr/local/bin/node]
25: 0x102bbabb4 v8::internal::MicrotaskQueue::PerformCheckpoint(v8::Isolate*) [/usr/local/bin/node]
26: 0x102abec4c v8::internal::MaybeHandlev8::internal::Object v8::internal::(anonymous namespace)::HandleApiCallHelper(v8::internal::Isolate*, v8::internal::Handlev8::internal::HeapObject, v8::internal::Handlev8::internal::FunctionTemplateInfo, v8::internal::Handlev8::internal::Object, unsigned long*, int) [/usr/local/bin/node]
27: 0x102abe344 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
28: 0x103344b24 Builtins_CEntry_Return1_ArgvOnStack_BuiltinExit [/usr/local/bin/node]
29: 0x10861d848
30: 0x1032ba50c Builtins_JSEntryTrampoline [/usr/local/bin/node]
31: 0x1032ba1f4 Builtins_JSEntry [/usr/local/bin/node]
32: 0x102b92cbc v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/usr/local/bin/node]
33: 0x102b92108 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Object, int, v8::internal::Handlev8::internal::Object) [/usr/local/bin/node]
34: 0x102a6c9d4 v8::Function::Call(v8::Localv8::Context, v8::Localv8::Value, int, v8::Localv8::Value) [/usr/local/bin/node]
35: 0x1027fcd3c node::InternalCallbackScope::Close() [/usr/local/bin/node]
36: 0x1027fd01c node::InternalMakeCallback(node::Environment*, v8::Localv8::Object, v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value, node::async_context) [/usr/local/bin/node]
37: 0x10281348c node::AsyncWrap::MakeCallback(v8::Localv8::Function, int, v8::Localv8::Value) [/usr/local/bin/node]
38: 0x1029971a4 node::StreamBase::CallJSOnreadMethod(long, v8::Localv8::ArrayBuffer, unsigned long, node::StreamBase::StreamBaseJSChecks) [/usr/local/bin/node]
39: 0x102998838 node::EmitToJSStreamListener::OnStreamRead(long, uv_buf_t const&) [/usr/local/bin/node]
40: 0x10299cb2c node::LibuvStreamWrap::OnUvRead(long, uv_buf_t const*) [/usr/local/bin/node]
41: 0x10299d2b0 node::LibuvStreamWrap::ReadStart()::$_1::__invoke(uv_stream_s*, long, uv_buf_t const*) [/usr/local/bin/node]
42: 0x1032a6f70 uv__stream_io [/usr/local/bin/node]
43: 0x1032ae874 uv__io_poll [/usr/local/bin/node]
44: 0x10329cd60 uv_run [/usr/local/bin/node]
45: 0x1027fd754 node::SpinEventLoopInternal(node::Environment*) [/usr/local/bin/node]
46: 0x10290d138 node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/usr/local/bin/node]
47: 0x10290ced4 node::NodeMainInstance::Run() [/usr/local/bin/node]
48: 0x10289560c node::Start(int, char**) [/usr/local/bin/node]
49: 0x187ce10e0 start [/usr/lib/dyld]
exit code 134 (interrupted by signal 6: SIGABRT)
Expected Result
build success
Actual Result
if i comment out sentryVitePlugin and it also can build complete
Product Area
Issues - Source Maps
Link
https://tankmiles-dei.sentry.io/releases/
DSN
https://c030969be018368bb25c4c054b4204d9@o4505038212694016.ingest.sentry.io/4506313168060416
Version
No response
The text was updated successfully, but these errors were encountered: