electron / electron/forge

Packaging OOM silently fails and does *not* exit with error code

Open
#3,965 5 comments 0 reactions 0 assignees View on GitHub
bug package
Dominant language
TypeScript
Stars
7.1k
Forks
641
Avg merge
3d 1h
Merged PRs (30d)
30

Description

### Pre-flight checklist

- [x] I have read the [contribution documentation](https://github.com/electron/forge/blob/main/CONTRIBUTING.md) for this project.
- [x] I agree to follow the [code of conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project uses.
- [x] I have searched the issue tracker for a bug that matches the one I want to file, without success.

### Forge version

7.8.0

### Electron version

35.1.4

### Operating system

using Mac, Windows and Linux OS from https://github.com/actions/runner-images

### Last known working Forge version

_No response_

### Expected behavior

If there's an error running `electron-forge publish` it should exit with an error code

### Actual behavior

I've seen this happen multiple times where `electron-forge publish` has an error and instead of exiting with an error code, it simply just ends with exit code 0 and doesn't actually publish the artifact.

Here's an example from my project:
https://github.com/dyad-sh/dyad/actions/runs/16395872602/job/46328291961

Here's the error stack trace (note that the workflow step does *not* fail because electron-forge publish is (surprisingly!) not exiting with an error code:

```
❯ [plugin-vite] Building vite bundles
vite v5.4.19 building for production...
Vite does not support "rollupOptions.output.sourcemap". Please use "build.sourcemap" instead.
vite v5.4.19 building for production...
vite v5.4.19 building for production...
vite v5.4.19 building for production...
transforming...
transforming...
transforming...
transforming...
✓ 1 modules transformed.
rendering chunks...
computing gzip size...
.vite/build/preload.js 2.59 kB │ gzip: 0.99 kB
✓ built in 396ms
✓ 3 modules transformed.
rendering chunks...
computing gzip size...
.vite/build/tsc_worker.js 6.03 kB │ gzip: 2.30 kB │ map: 27.82 kB
✓ built in 1.91s
✓ 1100 modules transformed.
rendering chunks...
computing gzip size...
.vite/build/main.js 2,577.27 kB │ gzip: 570.76 kB │ map: 13,217.69 kB
✓ built in 9.11s

<--- Last few GCs --->

[2589:0x158008000] 43652 ms: Mark-Compact (reduce) 2033.5 (2076.7) -> 2033.4 (2076.7) MB, 759.79 / 0.00 ms (average mu = 0.104, current mu = 0.000) last resort; GC in old space requested
[2589:0x158008000] 44148 ms: Mark-Compact (reduce) 2033.4 (2076.7) -> 2033.4 (2076.7) MB, 496.79 / 0.00 ms (average mu = 0.063, current mu = 0.000) last resort; GC in old space requested

<--- JS stacktrace --->

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

1: 0x102cb55b8 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
2: 0x102e73968 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
3: 0x1030770a0 v8::internal::MemoryController::MinimumAllocationLimitGrowingStep(v8::internal::Heap::HeapGrowingMode) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
4: 0x10305a5a8 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
5: 0x10304d9d8 v8::internal::FactoryBase::NewFixedArrayWithFiller(v8::internal::Handle, int, v8::internal::Handle, v8::internal::AllocationType) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
6: 0x10333f86c v8::internal::Handle v8::internal::HashTable::EnsureCapacity(v8::internal::Isolate*, v8::internal::Handle, int, v8::internal::AllocationType) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
7: 0x1033400f4 v8::internal::Handle v8::internal::Dictionary::Add(v8::internal::Isolate*, v8::internal::Handle, unsigned int, v8::internal::Handle, v8::internal::PropertyDetails, v8::internal::InternalIndex*) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
8: 0x103212e48 v8::internal::(anonymous namespace)::DictionaryElementsAccessor::AddImpl(v8::internal::Handle, unsigned int, v8::internal::Handle, v8::internal::PropertyAttributes, unsigned int) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
9: 0x1032d6928 v8::internal::JSObject::AddDataElement(v8::internal::Handle, unsigned int, v8::internal::Handle, v8::internal::PropertyAttributes) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
10: 0x103351b48 v8::internal::Object::AddDataProperty(v8::internal::LookupIterator*, v8::internal::Handle, v8::internal::PropertyAttributes, v8::Maybe, v8::internal::StoreOrigin, v8::internal::EnforceDefineSemantics) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
11: 0x10346ec78 v8::internal::Runtime::SetObjectProperty(v8::internal::Isolate*, v8::internal::Handle, v8::internal::Handle, v8::internal::Handle, v8::internal::StoreOrigin, v8::Maybe) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
12: 0x10346fce0 v8::internal::Runtime_SetKeyedProperty(int, unsigned long*, v8::internal::Isolate*) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
13: 0x1037fcc44 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
14: 0x1091caa04
15: 0x108c5b6dc
16: 0x103814b3c Builtins_ArrayForEach [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
17: 0x1037743e4 Builtins_InterpreterEntryTrampoline [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
18: 0x1037743e4 Builtins_InterpreterEntryTrampoline [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
19: 0x1037743e4 Builtins_InterpreterEntryTrampoline [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
20: 0x1037ab210 Builtins_AsyncFunctionAwaitResolveClosure [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
21: 0x103858fb8 Builtins_PromiseFulfillReactionJob [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
22: 0x10379ab94 Builtins_RunMicrotasks [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
23: 0x1037723f4 Builtins_JSRunMicrotasksEntry [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
24: 0x102fec22c v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
25: 0x102fecb58 v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
26: 0x102fecd44 v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate*, v8::internal::MicrotaskQueue*) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
27: 0x103017a34 v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
28: 0x1030181c0 v8::internal::MicrotaskQueue::PerformCheckpoint(v8::Isolate*) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
29: 0x102bccc84 node::InternalCallbackScope::Close() [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
30: 0x102bcc824 node::CallbackScope::~CallbackScope() [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
31: 0x102c7df24 (anonymous namespace)::uvimpl::Work::AfterThreadPoolWork(int) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
32: 0x102c7e340 node::ThreadPoolWork::ScheduleWork()::'lambda'(uv_work_s*, int)::operator()(uv_work_s*, int) const [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
33: 0x102c7e1f4 node::ThreadPoolWork::ScheduleWork()::'lambda'(uv_work_s*, int)::__invoke(uv_work_s*, int) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
34: 0x10374d500 uv__work_done [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
35: 0x103750f28 uv__async_io [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
36: 0x103763bd0 uv__io_poll [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
37: 0x103751490 uv_run [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
38: 0x102bcd7e8 node::SpinEventLoopInternal(node::Environment*) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
39: 0x102cf9eec node::NodeMainInstance::Run() [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
40: 0x102c77cfc node::Start(int, char**) [/Users/runner/hostedtoolcache/node/20.19.3/arm64/bin/node]
41: 0x184d5b154 start [/usr/lib/dyld]

```

### Steps to reproduce

Introduce some kind of issue in the publish step (e.g. cause an Out of Memory error by under-provisioning the RAM needed to compile an electron project).

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.