fix(workflows): esbuild binary path in packaged app (ENOENT) - #69
Merged
Conversation
Packaged workflow definitions failed to load with "spawn ...app.asar/.../esbuild.exe ENOENT": the workflow-loader bundles workflow.ts with esbuild, whose native binary esbuild resolves to a path inside app.asar. A .exe there is not a real file, so spawn gets ENOENT — every definition shows as "broken". Set ESBUILD_BINARY_PATH to the electron-builder smart-unpacked copy under app.asar.unpacked before the first build(), guarded by app.isPackaged (no-op in dev). Path computed by a pure esbuildBinaryPath() helper so it is unit-tested without Electron. Verified via build:win: the computed path matches the real unpacked esbuild.exe in dist/win-unpacked/resources/app.asar.unpacked. Closes #68 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problema
No app empacotado (
playground-nightly), toda definition de workflow aparece como broken:O
workflow-loaderbundleiaworkflow.tscomesbuild.build(), que dáspawnno binário nativo do esbuild. O esbuild resolve esse caminho relativo ao próprio pacote, que o electron-builder empacota dentro doapp.asar— e um.exedentro do asar não é arquivo real no filesystem → ENOENT. Só reproduz empacotado; emnpm run devo binário está solto emnode_modules.Correção
O electron-builder já faz smart-unpack de
@esbuild/*paraapp.asar.unpacked. Basta apontar a env oficialESBUILD_BINARY_PATHpara essa cópia real antes do primeirobuild(), guardado porapp.isPackaged(no-op em dev). O cálculo do caminho fica numa função puraesbuildBinaryPath(), testável sem Electron.Verificação
npm test→ 488 testes passando (2 novos cobrindoesbuildBinaryPathwin32/unix).npm run typecheckenpm run lintlimpos.npm run build:win→ o caminho calculado bate com o binário real emdist/win-unpacked/resources/app.asar.unpacked/node_modules/@esbuild/win32-x64/esbuild.exe.revisar-prsaindo de "broken" — não reproduzível em dev.Closes #68
🤖 Generated with Claude Code