Skip to content

[macOS 26] Packaged arm64 app crashes on launch (exit 133 / SIGTRAP): helper apps renamed but Electron binary not patched #9771

@ElRochito

Description

@ElRochito

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.appMyApp 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

  1. Create a standard Electron project with productName: "MyApp" in the electron-builder config
  2. Run electron-builder --mac --arm64 on macOS 26 (arm64 machine)
  3. Remove the quarantine attribute: xattr -dr com.apple.quarantine "dist/mac-arm64/MyApp.app"
  4. Launch the app or run the binary directly from terminal
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions