Failing when adding new "workspace:*" dependencies
What version of Bun is running?
1.0.20+09d51486e
What platform is your computer?
Darwin 23.2.0 arm64 arm
What steps can reproduce the bug?
Previously I've been able to add workspace dependencies like this:
"@scope/my-workspace-dependency": "workspace:*"
This also looks valid according to the documentation.
After adding a completely new workspace dependency like this I now suddenly get this when running bun install:
error: workspace dependency "@scope/my-workspace-dependency" not found
Searched in "./*"
The search path seems off, it should look in packages/* and apps/*. If I run bun install in the directory where the package with the added dependency installed I instead get:
error: workspace dependency "@scope/my-workspace-dependency" not found
Searched in "./@scope/my-workspace-dependency"
A workaround I've found is to specify the workspace dependency with relative path, but it is not as clean as workspace:*:
"@scope/my-workspace-dependency": "workspace:../../packages/my-workspace-dependency"
What is the expected behavior?
I would expect the install to succeed, as it did in previous versions.
What do you see instead?
error: workspace dependency "@scope/my-workspace-dependency" not found
Searched in "./*"
Additional information
No response
I'm using workspace dependencies with Bun and it works just fine with workspace:*. Are you sure that a) the correct name is present in the package.json for my-workspace-dependency, and b) that you're using the latest version of Bun (v1.0.20)?
@aarvinr It seems to only happen for completely new workspace packages, once I've managed to run bun install once it works to reference by "workspace:*" again
@aarvinr It seems to only happen for completely new workspace packages, once I've managed to run
bun installonce it works to reference by "workspace:*" again
Can confirm this behavior... Super annoying having to spend a bunch of time getting bun to first recognize a package
I was on 1.0.2, and I just upgraded to the latest version and it seems to be fixed.
Thanks @donnes. Running bun upgrade fixed it for me as well. I believe it was solved on v1.1.9