Skip to content

fix(app): spawn bun by absolute path in e2e-local to fix Windows e2e - #80

Merged
nikomatt69 merged 1 commit into
nikomatt69:live-mainfrom
SandroHub013:fix/windows-e2e-bun-trampoline
May 23, 2026
Merged

fix(app): spawn bun by absolute path in e2e-local to fix Windows e2e#80
nikomatt69 merged 1 commit into
nikomatt69:live-mainfrom
SandroHub013:fix/windows-e2e-bun-trampoline

Conversation

@SandroHub013

@SandroHub013 SandroHub013 commented May 23, 2026

Copy link
Copy Markdown
Collaborator

Issue for this PR

Closes #79

Type of change

  • Bug fix

What does this PR do?

The test (windows) job fails on every run, before the e2e script even starts:

$ bun script/e2e-local.ts
error: could not create process
Bun failed to remap this bin to its proper location within node_modules.

Root cause is a nested bun resolving a broken trampoline. The job runs bun test:e2e:local, whose package-script value is bun script/e2e-local.ts. That nested bun token resolves through node_modules/.bin, where the Windows install (bun install --linker hoisted, the documented workaround for oven-sh/bun#28147) leaves a broken .exe trampoline.

Two changes fix it:

  1. ci(test): run the script file directly (bun script/e2e-local.ts) instead of via the bun test:e2e:local package script, so there is no nested package-script bun to resolve through node_modules/.bin.
  2. fix(app): inside e2e-local.ts, spawn child bun processes by absolute path (process.execPath) instead of the bare string "bun", so the seed and playwright spawns don't hit the trampolines either.

How did you verify your code works?

The failure only reproduces on the Windows CI runner (fresh hoisted install), not locally. With the first version of this PR (in-script fix only) the Windows job got further — it failed after ~6 min at the same nested-bun point rather than immediately — which confirmed the remaining failure was the package-script indirection, addressed by change #1. The real verification is this PR's test (windows) job.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…ampoline

The Windows e2e job (`test (windows)`) failed deterministically: `bun
script/e2e-local.ts` started, but its first child spawn `Bun.spawn(["bun",
...])` resolved `bun` through node_modules/.bin, where the hoisted-linker
install on Windows (workaround for oven-sh/bun#28147) produces a broken .exe
trampoline:

    error: could not create process
    Bun failed to remap this bin to its proper location within node_modules.

Spawn the running bun binary by absolute path (process.execPath) instead of
the bare string "bun" so the spawn no longer depends on trampoline resolution.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@SandroHub013
SandroHub013 requested a review from nikomatt69 as a code owner May 23, 2026 20:09
@nikomatt69
nikomatt69 merged commit 1cd4ede into nikomatt69:live-main May 23, 2026
10 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows e2e (test (windows)) always fails: nested bun spawn hits broken hoisted-linker trampoline

2 participants