sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

sentry-vite-plugin cause javascript out of memory

Open 850036165 opened this issue 2 years ago • 21 comments

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

[email protected] build vite build --mode production

[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 to false. 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

850036165 avatar Dec 01 '23 03:12 850036165