'rollup run dev aborts
I'm working in a Svelte project with rollup. After working for a while, when I try to restart de project in production to see the changes and I write 'npm run dev' the terminal returns a huge message of error:
[1702:0x150008000] 29988 ms: Scavenge 4048.7 (4129.6) -> 4041.0 (4129.6) MB, 5.1 / 0.0 ms (average mu = 0.341, current mu = 0.250) allocation failure
[1702:0x150008000] 30258 ms: Scavenge 4049.2 (4129.9) -> 4042.3 (4130.1) MB, 5.5 / 0.0 ms (average mu = 0.341, current mu = 0.250) allocation failure
[1702:0x150008000] 33486 ms: Mark-sweep 4078.0 (4159.0) -> 4072.3 (4160.7) MB, 3173.5 / 0.0 ms (average mu = 0.432, current mu = 0.484) allocation failure scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
1: 0x1009c446c node::Abort() [/usr/local/bin/node]
2: 0x1009c45f4 node::errors::TryCatchScope::~TryCatchScope() [/usr/local/bin/node]
3: 0x100b127b4 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
4: 0x100b12748 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
5: 0x100c95c08 v8::internal::Heap::GarbageCollectionReasonToString(v8::internal::GarbageCollectionReason) [/usr/local/bin/node]
6: 0x100c94728 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
7: 0x100c9fa04 v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
8: 0x100c9fa98 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
9: 0x100c754c8 v8::internal::Factory::NewProperSubString(v8::internal::Handle<v8::internal::String>, int, int) [/usr/local/bin/node]
10: 0x100fb70d0 v8::internal::Runtime_StringSplit(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
11: 0x1012bc2ec Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/usr/local/bin/node]
12: 0x1012b081c Builtins_StringPrototypeSplit [/usr/local/bin/node]
13: 0x1054d6be4
14: 0x10550feb8
15: 0x10124cf78 construct_stub_create_deopt_addr [/usr/local/bin/node]
16: 0x1055761e8
17: 0x105578d64
18: 0x1055c8d9c
19: 0x10124ff78 Builtins_InterpreterEntryTrampoline [/usr/local/bin/node]
20: 0x10124ff78 Builtins_InterpreterEntryTrampoline [/usr/local/bin/node]
21: 0x10127f574 Builtins_AsyncFunctionAwaitResolveClosure [/usr/local/bin/node]
22: 0x101304418 Builtins_PromiseFulfillReactionJob [/usr/local/bin/node]
23: 0x101271954 Builtins_RunMicrotasks [/usr/local/bin/node]
24: 0x10124dc44 Builtins_JSRunMicrotasksEntry [/usr/local/bin/node]
25: 0x100c22450 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/usr/local/bin/node]
26: 0x100c22884 v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/usr/local/bin/node]
27: 0x100c22970 v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate*, v8::internal::MicrotaskQueue*, v8::internal::MaybeHandle<v8::internal::Object>*) [/usr/local/bin/node]
28: 0x100c4559c v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) [/usr/local/bin/node]
29: 0x100c45e30 v8::internal::MicrotaskQueue::PerformCheckpoint(v8::Isolate*) [/usr/local/bin/node]
30: 0x100913d8c node::InternalCallbackScope::Close() [/usr/local/bin/node]
31: 0x10091436c node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context) [/usr/local/bin/node]
32: 0x1009294ac node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/usr/local/bin/node]
33: 0x1009c874c node::fs::FSReqCallback::Resolve(v8::Local<v8::Value>) [/usr/local/bin/node]
34: 0x1009c8ea4 node::fs::AfterNoArgs(uv_fs_s*) [/usr/local/bin/node]
35: 0x10122e3b0 uv__work_done [/usr/local/bin/node]
36: 0x101231b10 uv__async_io [/usr/local/bin/node]
37: 0x101243824 uv__io_poll [/usr/local/bin/node]
38: 0x101231fa0 uv_run [/usr/local/bin/node]
39: 0x100914e00 node::SpinEventLoop(node::Environment*) [/usr/local/bin/node]
40: 0x1009fd638 node::NodeMainInstance::Run(int*, node::Environment*) [/usr/local/bin/node]
41: 0x1009fd304 node::NodeMainInstance::Run(node::EnvSerializeInfo const*) [/usr/local/bin/node]
42: 0x1009962ec node::Start(int, char**) [/usr/local/bin/node]
43: 0x18e338f34 start [/usr/lib/system/libdyld.dylib]
zsh: abort npm run dev
I've already tried to uninstall and install homebrewer, node and rollup. This situation happens right after I had to quit Visual Studio Code because the localhost:5000 wasn't updating the new changes because of this error:
ERR_CONNECTION_REFUSED http://localhost:35729/livereload.js?snipver=1
In order to solve that (with no success) I've tried to make changes at rollup.config.js following different advices from the stack overflow issues like, updating the LiveReload plugin for rollup, this potencial solution or this one, among others. None of them has worked for me. Any tips? Thanks!
Solution 1:[1]
I'm not sure exactly what the issue is but I've been using a temporary work around by increasing the node heap memory allocation in my local environment. Setting export NODE_OPTIONS=--max-old-space-size=8192
increases the node heap memory allocation to 8GB. Note you may have to change 8192 to some larger multiple of 1024 in order to have sufficient heap memory when building depending on the size of your application.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Jack French |