bun
bun copied to clipboard
Workspace dependency not found
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.
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.
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.
@dylan-conway is working on a fix