bun icon indicating copy to clipboard operation
bun copied to clipboard

Workspace dependency not found

Open nervetattoo opened this issue 1 year ago • 3 comments

What version of Bun is running?

1.1.8+89d25807f

What platform is your computer?

Darwin 23.3.0 arm64 arm

What steps can reproduce the bug?

Seeing a regression when going from 1.1.7 to 1.1.8

Monorepo root package.json has:

{
  "workspaces": [
    "{apps,packages}/**"
  ]
}

Now from say apps/foo which has a workspace dependency that is covered by packages/schema

{
  "dependencies": {
      "schema": "workspace:*",
  }
}

When I run bun add <anything> in 1.1.8 it ends in the error

error: workspace dependency "schema" not found

Searched in "./schema"

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

I tried bun i -f from root which did nothing, then I tried removing bun.lockb and doing bun i in case some weird things were encoded in the lockfile after upgrading to 1.1.8. Nothing helped.

nervetattoo avatar May 14 '24 08:05 nervetattoo

The relevant piece is having two workspace roots and then grabbing a workspace dependency from the other root (apps/foo depending on packages/lib). That seems to repro it for me.

nervetattoo avatar May 14 '24 10:05 nervetattoo

Same here. After upgrading to 1.1.8 can't bun add in a workspace package. The workaround I could think of is manually adding a dep to package.json and then running bun i from the workspace root.

MonsterDeveloper avatar May 16 '24 12:05 MonsterDeveloper

@dylan-conway is working on a fix

Jarred-Sumner avatar May 16 '24 12:05 Jarred-Sumner