Skip to content

fix(coding-agent): guard undici install under Bun#4661

Merged
badlogic merged 2 commits into
earendil-works:mainfrom
dmasiero:fix-bun-undici-install-clean
May 18, 2026
Merged

fix(coding-agent): guard undici install under Bun#4661
badlogic merged 2 commits into
earendil-works:mainfrom
dmasiero:fix-bun-undici-install-clean

Conversation

@dmasiero
Copy link
Copy Markdown

Summary

Fix the v0.75.1 Bun-compiled release binary startup crash caused by statically importing install from undici.

Bun's built-in undici module exposes EnvHttpProxyAgent and setGlobalDispatcher, but not install, so the binary fails during module loading with:

SyntaxError: Export named 'install' not found in module 'undici'.

This changes the import to a namespace import and calls install() only when that export exists. That should preserve the Node 26 fix for #4650, #4652, and #4653, because npm undici still exports install() under Node, while avoiding the Bun startup crash where the export is absent.

Fixes #4657.

Testing

  • npm run check
  • Built the patched binary in a separate local worktree and verified pi --version / pi --help work after installing through my NixOS flake

@github-actions
Copy link
Copy Markdown
Contributor

This PR was auto-closed. Only contributors approved with lgtm can open PRs. Open an issue first.

Maintainers review auto-closed issues daily. Issues that do not meet the quality bar in CONTRIBUTING.md will not be reopened or receive a reply.

If a maintainer replies lgtmi, your future issues will stay open. If a maintainer replies lgtm, your future issues and PRs will stay open.

See CONTRIBUTING.md.

@github-actions github-actions Bot closed this May 18, 2026
@badlogic
Copy link
Copy Markdown
Collaborator

cheers

@badlogic badlogic reopened this May 18, 2026
@badlogic badlogic merged commit 936f55b into earendil-works:main May 18, 2026
@badlogic
Copy link
Copy Markdown
Collaborator

cheers

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.

pi v0.75.1 fails to start with "SyntaxError: Export named 'install' not found in module 'undici'."

2 participants