Environment
|
|
| electron-builder |
26.x |
| electron |
42.2.0 |
| macOS |
26.5 (Darwin 25.5.0, Apple Silicon arm64) |
| Node.js |
22.x |
| Package manager |
pnpm |
Describe the bug
A macOS arm64 app packaged with electron-builder --mac crashes immediately on launch with exit code 133 (SIGTRAP) and produces no output. The crash happens before any JavaScript runs.
Running the app binary directly from the terminal confirms the fatal error:
[FATAL:electron/shell/app/electron_main_delegate_mac.mm:66] Unable to find helper app
The app works correctly in development mode (electron .).
Root cause
electron-builder renames the helper .app bundles inside Contents/Frameworks/ to match the product name (e.g. Electron Helper.app → MyApp Helper.app) but does not patch the main Electron binary to reflect the new name.
The packaged binary has an identical SHA-256 hash to the original binary from the npm package, confirming it was never modified:
shasum -a 256 "dist/mac-arm64/MyApp.app/Contents/MacOS/MyApp"
# c86c2701f15ca66ba460f4cdcd7ebcab0b5133a4cc299295f02108b3754e9eed
shasum -a 256 "node_modules/.pnpm/electron@42.2.0/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron"
# c86c2701f15ca66ba460f4cdcd7ebcab0b5133a4cc299295f02108b3754e9eed
The unmodified binary still looks for Electron Helper.app at runtime, which no longer exists after renaming.
This was verified by renaming the helpers back to their original names via an afterPack hook. The app launches successfully with that workaround in place.
Steps to reproduce
- Create a standard Electron project with
productName: "MyApp" in the electron-builder config
- Run
electron-builder --mac --arm64 on macOS 26 (arm64 machine)
- Remove the quarantine attribute:
xattr -dr com.apple.quarantine "dist/mac-arm64/MyApp.app"
- Launch the app or run the binary directly from terminal
- App exits immediately with code 133, no output
Expected behavior
The packaged app launches correctly. electron-builder should either:
- patch the Electron binary to replace the hardcoded
Electron Helper string with the product name (as it apparently did in earlier versions), or
- not rename the helper bundles at all and leave that responsibility to Electron's runtime resolution.
Workaround
Add an afterPack hook that renames the helpers back to their original Electron Helper names:
package.json
{
"build": {
"afterPack": "./scripts/afterPack.js"
}
}
scripts/afterPack.js
const fs = require('fs')
const path = require('path')
exports.default = async function ({ appOutDir, packager }) {
if (packager.platform.name !== 'mac') return
const frameworksDir = path.join(
appOutDir,
`${packager.appInfo.productFilename}.app`,
'Contents',
'Frameworks'
)
const product = packager.appInfo.productFilename
const suffixes = ['', ' (GPU)', ' (Plugin)', ' (Renderer)']
for (const suffix of suffixes) {
const src = path.join(frameworksDir, `${product} Helper${suffix}.app`)
const dst = path.join(frameworksDir, `Electron Helper${suffix}.app`)
if (!fs.existsSync(src) || fs.existsSync(dst)) continue
fs.renameSync(src, dst)
const macOSDir = path.join(dst, 'Contents', 'MacOS')
const oldBin = path.join(macOSDir, `${product} Helper${suffix}`)
const newBin = path.join(macOSDir, `Electron Helper${suffix}`)
if (fs.existsSync(oldBin)) fs.renameSync(oldBin, newBin)
}
}
Additional context
- The issue is reproducible with both
hardenedRuntime: true and hardenedRuntime: false.
- Setting
identity: null (skip code signing) does not affect the outcome — the binary is never patched regardless of signing configuration.
- The
node_modules Electron binary (linker-signed, never re-signed by electron-builder) launches correctly with the app's app.asar.
- All FUSE flags (including
EnableEmbeddedAsarIntegrityValidation) are identical between the working and failing binaries.
- This may be a macOS 26 regression if previous versions were more lenient in resolving helper app names — testing on macOS 15 would be welcome.
See also: companion issue filed against the Electron repository regarding making he
Environment
Describe the bug
A macOS arm64 app packaged with
electron-builder --maccrashes immediately on launch with exit code 133 (SIGTRAP) and produces no output. The crash happens before any JavaScript runs.Running the app binary directly from the terminal confirms the fatal error:
The app works correctly in development mode (
electron .).Root cause
electron-builder renames the helper
.appbundles insideContents/Frameworks/to match the product name (e.g.Electron Helper.app→MyApp Helper.app) but does not patch the main Electron binary to reflect the new name.The packaged binary has an identical SHA-256 hash to the original binary from the npm package, confirming it was never modified:
The unmodified binary still looks for
Electron Helper.appat runtime, which no longer exists after renaming.This was verified by renaming the helpers back to their original names via an
afterPackhook. The app launches successfully with that workaround in place.Steps to reproduce
productName: "MyApp"in the electron-builder configelectron-builder --mac --arm64on macOS 26 (arm64 machine)xattr -dr com.apple.quarantine "dist/mac-arm64/MyApp.app"Expected behavior
The packaged app launches correctly. electron-builder should either:
Electron Helperstring with the product name (as it apparently did in earlier versions), orWorkaround
Add an
afterPackhook that renames the helpers back to their originalElectron Helpernames:package.json
{ "build": { "afterPack": "./scripts/afterPack.js" } }scripts/afterPack.js
Additional context
hardenedRuntime: trueandhardenedRuntime: false.identity: null(skip code signing) does not affect the outcome — the binary is never patched regardless of signing configuration.node_modulesElectron binary (linker-signed, never re-signed by electron-builder) launches correctly with the app'sapp.asar.EnableEmbeddedAsarIntegrityValidation) are identical between the working and failing binaries.See also: companion issue filed against the Electron repository regarding making he