Skip to content

Incorrect Quoting in generated lockfile with bun install --yarn #20774

@delafthi

Description

@delafthi

What version of Bun is running?

1.2.17

What platform is your computer?

aarch64-darwin

What steps can reproduce the bug?

  1. Use bun install --yarn on a project with dependencies that use workspace or catalog protocols. I encountered this in sst/opencode, examples are also taken from that repo.
  2. Copy yarn.lock into an empty directory.
  3. Init the empty directory with yarn init
  4. Install dependencies with yarn install --frozen-lockfile
  5. Observe the error output. The line numbers are messed up. However, searching for packages with @workspace:* and @catalog: and adding quotes around unquoted occurrences fixes the lockfile.

What is the expected behavior?

Dependencies with special characters or scoped names should be properly quoted as strings. For example:

  • ai@catalog:*: should appear as "ai@catalog:*":
  • opencode@workspace:*: should appear as "opencode@workspace:*:":

What do you see instead?

The dependencies are output without quotes, for example:

  • ai@catalog::
  • opencode@workspace:*:

Additional information

I don't have any experience with typescript/bun/yarn. So I'm not sure if catalog: and workspace:* are even supported by yarn.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingbun installSomething that relates to the npm-compatible client

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions