Reached heap limit

We started getting random build errors and here is the error that we are receiving during build process:

We have a react app that is using vite for builds.

What might be the issue? Also added --max-old-space-size=8192 cmd to build command but no luck.
<--- JS stacktrace --->
19:35:49.630    
19:35:49.630    FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
19:35:49.630    ----- Native stack trace -----
19:35:49.630    
19:35:49.650     1: 0xb82c28 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node]
19:35:49.651     2: 0xeed540 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
19:35:49.652     3: 0xeed827 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*,
19:35:49.866    Failed: Error while executing user command. Exited with error code: 134
19:35:49.876    Failed: build command exited with code: 1
19:35:50.816    Failed: error occurred while running build command
Was this page helpful?