vercel / turborepo

Build system optimized for JavaScript and TypeScript, written in Rust
https://turbo.build/repo/docs
MIT License
26.46k stars 1.84k forks source link

Support pnpm.ignoreOptionalDependencies when pruning lockfile #8959

Open GeorgS opened 3 months ago

GeorgS commented 3 months ago

Verify canary release

Link to code that reproduces this issue

https://github.com/GeorgS/turbo-reproduce-ignored-optional-dependencies

What package manager are you using / does the bug impact?

pnpm

What operating system are you using?

Mac

Which canary version will you have in your reproduction?

2.0.12

Describe the Bug

When using pnpm.ignoredOptionalDependencies in package.json and then pruning the lockfile, the ignoredOptionalDependencies key is not present in the pruned pnpm-lock.yaml.

This results in an error when trying to install using pnpm install --frozen-lockfile:

ERR_PNPM_LOCKFILE_CONFIG_MISMATCH  Cannot proceed with the frozen installation.
The current "ignoredOptionalDependencies" configuration doesn't match the value found in the lockfile

Update your lockfile using "pnpm install --no-frozen-lockfile"

This is how it is defined in the original pnpm-lock.yaml: https://github.com/GeorgS/turbo-reproduce-ignored-optional-dependencies/blob/main/pnpm-lock.yaml#L148-L149

Expected Behavior

The ignoredOptionalDependencies is carried over from the original lockfile.

To Reproduce

Additional context

No response

ragrag commented 2 months ago

@GeorgS do you have any workarounds for this? i hacked around it with something like this but its not the cleanest

"pnpm": {
    "overrides": {
      "typeorm>ts-node": "file:empty",
      "vue>typescript": "file:empty",
    }
 }
ragrag commented 1 month ago

@chris-olszewski any plans for support for this? 🙏🏻 sorry for bumping