Skip to content

workspace packages list gets stale if new workspace packages are depended on #3686

@scinos

Description

@scinos

What version of Bun is running?

v0.6.15 (1790357)

What platform is your computer?

Darwin 21.6.0 arm64 arm

What steps can reproduce the bug?

Create a file package.json with:

{
  "name": "bun-workspaces",
  "module": "index.ts",
  "type": "module",
  "workspaces": [
    "packages/a"
  ],
  "dependencies": {
    "a": "workspace:^"
  }
}

Create a second file packages/a/package.json with:

{
  "name": "a",
  "version": "1.0.0"
}

Then run bun install in the root.

What is the expected behavior?

It creates a node_moudules with a symlinked to packages/a.

What do you see instead?

Error

error: Workspace name "a" already exists
{
^

Additional information

As a workaround, replacing workspace:^ with workspace:* works.

For reference, these are the semantics of the workspace: protocol in yarn and pnpm.

image

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