You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bundled binary crashes with TypeError on namespace re-exports #18525
The Bun-bundled binary crashes at startup with errors like:
TypeError: undefined is not an object (evaluating 'Snapshot2.FileDiff.array')
TypeError: undefined is not an object (evaluating 'ProviderAuth2.Authorization.optional')
Root cause
Nine facade files (e.g. src/snapshot/index.ts, src/provider/auth.ts) re-export values from a service module inside a TypeScript namespace:
Bun's bundler transpiles this into self-referential assignments (Snapshot.FileDiff = Snapshot.FileDiff). When circular imports delay module initialization, the right-hand side is undefined.
Steps to reproduce
Introduce any circular dependency chain that passes through one of these facade modules
Activity
github-actions commentedon Mar 21, 2026
This issue might be a duplicate of an existing issue. Please check:
build.ts --singleproduces black screen + freeze #18451: Same crash —TypeError: undefined is not an object (evaluating 'Snapshot2.FileDiff.array')— caused by the same circular dependency / namespace re-export problem in the--singlebundled binary. That issue also tracks the bisect result and links to related PRs (fix: apply Layer.fresh at instance service definition site #18418, fix: switch consumers to service imports to break bundle cycles #18438).Please check whether #18451 already covers your case. If so, it may be best to add any new details there.
github-actions commentedon Jul 4, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.