-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
turbo prune
produces a broken pnpm-lock.yaml
lockfile with injected dependencies
#2118
Comments
turbo prune
produces broken pnpm-lock.yaml
lockfile with injected dependenciesturbo prune
produces a broken pnpm-lock.yaml
lockfile with injected dependencies
I think #2121 should fix this. Thank you so much for providing a repro, it helped a lot! |
That was fast! Thank you! |
I just tried to run
It couldn't find the |
I created an additional example with-injected-dev-dep in the same repository. Steps to reproduce: # pull the repository
$ git pull
$ pnpm turbo prune --scope=with-injected-dev-dep It'll fail with the following error
I think here we can also lookup DevDependencies and it will fix the issue: resolution, ok := importer.Dependencies[dependency]
if !ok {
resolution, ok = importer.DevDependencies[dependency]
} |
Thanks so much for testing out my fix and finding that issue. I updated the PR to now have better error messaging and it should handle injected dev and optional dependencies now. |
You’re welcome, I’m glad to help. |
What version of Turborepo are you using?
1.5.4
What package manager are you using / does the bug impact?
pnpm
What operating system are you using?
Mac
Describe the Bug
prune
command produces a brokenpnpm
lockfile if some dependency is marked asinjected
. If dependency is marked asinjected
, pnpm creates special lockfile entry withfile:
protocol. But these entries are missing inturbo prune
result.Expected Behavior
The lock file should be valid.
To Reproduce
pnpm
version: v7.12.2Clone the issue example repository and install dependencies via
pnpm
This repository contains one shared package:
And two apps that depend on it:
packages/internal-package
added as a regular dependencypackages/internal-package
added as "injected" dependency. Here you can find the injection directive for@monorepo/internal-package
Next, call the
prune
command onwith-regular-dep
app, and try to install the dependencies:The dependencies will be installed, and everything will work as expected.
Now try to do the same with
with-injected-dep
app:The installation will fail with the following error:
If we look at the original
./pnpm-lock.yaml
in the root of the repository, we can find the specialfile:packages/internal-package
entry pointing to the "injected" package. But it's missing in./out/pnpm-lock.yaml
The text was updated successfully, but these errors were encountered: