Skip to content

Fix desktop launch: export bb-app/dist/bb-app.js - #392

Merged
SawyerHood merged 1 commit into
mainfrom
fix/bb-app-dist-bb-app-export
Jun 25, 2026
Merged

SawyerHood merged 1 commit into
mainfrom
fix/bb-app-dist-bb-app-export

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

Problem

The packaged desktop app crashes at startup:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/bb-app.js' is
not defined by "exports" in .../node_modules/bb-app/package.json imported from
.../dist/bb-app-bridge.mjs

Root cause

The desktop bridge (apps/desktop/src/bb-app-bridge.ts) boots the app via a
side-effect import of the launcher entry:

import "bb-app/dist/bb-app.js";

Before #343, bb-app had no exports field, so Node allowed any deep import.
#343 ("Expose public bb-app SDK") added an exports map declaring only the
"." entry. Once exports is present, Node's exports encapsulation rejects
every subpath that isn't listed — breaking the bridge's deep import.

npx bb-app is unaffected because it launches through the bin field (a direct
file path that bypasses module-exports resolution), which is why only the
desktop app failed.

Fix

Add the ./dist/bb-app.js subpath to the exports map. Verified with
import.meta.resolve that both the deep launcher import and the root SDK entry
resolve correctly.

🤖 Generated with Claude Code

The desktop bridge boots the app via `import "bb-app/dist/bb-app.js"`, but
the `exports` map added in #343 only declared the `"."` entry. Node's exports
encapsulation then rejects every unlisted subpath, so the packaged desktop app
crashed at startup with ERR_PACKAGE_PATH_NOT_EXPORTED. (npx is unaffected: it
launches via the `bin` field, a direct file path that bypasses exports.)

Add the `./dist/bb-app.js` subpath to `exports` so the launcher entry resolves.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@SawyerHood
SawyerHood merged commit 0a25e52 into main Jun 25, 2026
6 checks passed
@SawyerHood
SawyerHood deleted the fix/bb-app-dist-bb-app-export branch June 25, 2026 18:53
SawyerHood added a commit that referenced this pull request Jun 25, 2026
Patch release carrying the desktop launch fix (#392): export
bb-app/dist/bb-app.js so the packaged desktop bridge can boot.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
brsbl added a commit that referenced this pull request Oct 9, 2026
…d edge, general 3D guidance

Ports brsbl/bb-plugins 621f3faeb, a9106eaa1 and 70477277f.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

1 participant