-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Verify canary release
- I verified that the issue exists in the latest Turborepo canary release.
Link to code that reproduces this issue
https://github.com/me4502/turborepo-reproduction
What package manager are you using / does the bug impact?
Yarn v2/v3/v4 (node_modules linker only)
What operating system are you using?
Mac
Which canary version will you have in your reproduction?
2.0.12-canary.3
Describe the Bug
When a dependency using Yarn's npm:
protocol exists that has the same name as a workspace in the repo, turborepo incorrectly builds the repo with that name. This causes issues in cases where FFI-requiring packages are built on CI and used purely via NPM rather than local workspaces.
Expected Behavior
As these dependencies come from npm, and not the workspace of the same name, the workspace should not be built nor considered part of turborepo's dependency graph.
To Reproduce
- Clone https://github.com/me4502/turborepo-reproduction
- Run
yarn
in the root of the repo cd
toworkspaces/a
- Run
yarn build:turbo
As can be seen in the output, the buffer workspace's build
script has been incorrectly run, despite it not being a dependency of the a
workspace.
Additional context
The important parts of this setup are that there's a package called buffer
being used by workspace a
, and a workspace also named buffer
. The repro is setup to specifically use the dependency from npm, so it should not be building the workspace copy as it's redundant (and in the case of FFI dependencies, potentially impossible from local development machines).