Skip to content

Conversation

anthonyshew
Copy link
Contributor

When creating pruned lockfiles (subgraphs), the Bun lockfile parser was not including bundled dependencies that are stored with scoped package keys. This caused 'bun install' to fail with errors like:

error: Failed to resolve prod dependency '@emnapi/core' for package '@tailwindcss/oxide-wasm32-wasi'

Bundled dependencies in Bun lockfiles are stored with scoped keys (e.g., '@tailwindcss/oxide-wasm32-wasi/@emnapi/core') and have 'bundled': true in their metadata. When filtering packages for a subgraph, we now:

  1. Collect packages matching the requested idents
  2. For each included package, check for scoped dependencies (keys starting with '<parent_key>/')
  3. Include those scoped dependencies if they have 'bundled': true

This ensures bundled dependencies are preserved in pruned lockfiles while not including regular scoped overrides.

Fixes the issue where pruned lockfiles would fail to install with Bun.

When creating pruned lockfiles (subgraphs), the Bun lockfile parser was not including bundled dependencies that are stored with scoped package keys. This caused 'bun install' to fail with errors like:

  error: Failed to resolve prod dependency '@emnapi/core' for package '@tailwindcss/oxide-wasm32-wasi'

Bundled dependencies in Bun lockfiles are stored with scoped keys (e.g., '@tailwindcss/oxide-wasm32-wasi/@emnapi/core') and have 'bundled': true in their metadata. When filtering packages for a subgraph, we now:

1. Collect packages matching the requested idents
2. For each included package, check for scoped dependencies (keys starting with '<parent_key>/')
3. Include those scoped dependencies if they have 'bundled': true

This ensures bundled dependencies are preserved in pruned lockfiles while not including regular scoped overrides.

Fixes the issue where pruned lockfiles would fail to install with Bun.
@anthonyshew anthonyshew requested a review from a team as a code owner October 2, 2025 17:22
@anthonyshew anthonyshew requested a review from tknickman October 2, 2025 17:22
Copy link
Contributor

vercel bot commented Oct 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
examples-basic-web Ready Ready Preview Comment Oct 2, 2025 5:32pm
examples-designsystem-docs Ready Ready Preview Comment Oct 2, 2025 5:32pm
examples-gatsby-web Ready Ready Preview Comment Oct 2, 2025 5:32pm
examples-kitchensink-blog Ready Ready Preview Comment Oct 2, 2025 5:32pm
examples-nonmonorepo Ready Ready Preview Comment Oct 2, 2025 5:32pm
examples-svelte-web Ready Ready Preview Comment Oct 2, 2025 5:32pm
examples-tailwind-web Ready Ready Preview Comment Oct 2, 2025 5:32pm
examples-vite-web Ready Ready Preview Comment Oct 2, 2025 5:32pm
turbo-site Ready Ready Preview Comment Oct 2, 2025 5:32pm
@anthonyshew anthonyshew merged commit 9157566 into main Oct 2, 2025
57 of 58 checks passed
@anthonyshew anthonyshew deleted the fix-bun-lockfile-bundled-dependencies branch October 2, 2025 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant