Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't depend on workspace packages #3644

Closed
scinos opened this issue Jul 16, 2023 · 2 comments · Fixed by #3662
Closed

Can't depend on workspace packages #3644

scinos opened this issue Jul 16, 2023 · 2 comments · Fixed by #3662
Labels
bug Something isn't working npm Something that relates to the npm-compatible client

Comments

@scinos
Copy link

scinos commented Jul 16, 2023

What version of Bun is running?

0.6.14

What platform is your computer?

Darwin 21.6.0 arm64 arm

What steps can reproduce the bug?

Create package.json with:

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

Then packages/b/package.json with:

{
  "name": "b",
  "version": "1.0.0",
  "module": "index.ts",
  "type": "module"
}

What is the expected behavior?

Running bun i in the root of the project should work, and I should have node_modules/b symlinked to packages/b

What do you see instead?

Fails with the error:

bun install v0.6.14 (b5665739)


error: Workspace name "b" already exists
{
^
/Users/sergio/src/experiments/bun-workspaces/package.json:1:1 0

Additional information

It works if I remove the dependency on b in package.json. But it goes against what other package managers do, and agains the docs in https://bun.sh/docs/install/workspaces

Also, it doesn't matter if I depend on b: "*", b: "1.0.0" or any other variant, I always get the same error regarding duplicated workspace.

@scinos scinos added the bug Something isn't working label Jul 16, 2023
@robobun robobun added the npm Something that relates to the npm-compatible client label Jul 17, 2023
alexlamsl added a commit to alexlamsl/bun that referenced this issue Jul 17, 2023
@scinos
Copy link
Author

scinos commented Jul 18, 2023

This still fails when using

  "dependencies": {
    "b": "workspace:^"
  }

But works when using:

  "dependencies": {
    "b": "workspace:*"
  }

Not sure if this is a bug, or expected behaviour.

@scinos
Copy link
Author

scinos commented Jul 19, 2023

Raised the problem with workspace:^ as a separate issue in #3686

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working npm Something that relates to the npm-compatible client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants