-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
[Bug]: dev = True
support missing from pnpm version 9 lockfiles
#2013
Comments
I tried to solve this locally, but I'm kind of confused about how this should interact with Also, it seems dev packages are filtered out twice, once during the transitive closure generation and another in |
I think that's why pnpm v9 removed the flag completely, and why
I think this is still correct, although buggy atm (which I believe #2051 fixes). The first filter during the generation simply avoids generating unused code. |
But transitive dependencies should contain "dev dependencies". Whether a package is a dev dependency or not should only have bearing on the roots of the package graph, not the full graph. pnpm should already exclude transitive dependencies' own dev dependencies by simply not installing them. Am I misunderstanding something here? |
I think that is true up until a package gets published, or linked into a But your repro steps do seem to show a bug... when just using Does that sound right? |
Not quite. See the graph here: #1879 (comment) One package's |
I mean what it should do. I think you are correct that it's broken in the scenario you're pointing out in that graph (point 2 below). I think there are 2 related issues here, both caused by rule_js misusing the lockfile
|
What happened?
I added the following to my
MODULE.bazel
:The intention here is to use this together with
ts_project
because right now it's including dev dependencies in its output (which might actually be related to this issue...).However, when I add
dev = True
, no dependencies actually get included in the resulting linked packages, and I get errors related to missing type declarations.Version
Development (host) and target OS/architectures: Host+target: Gentoo Linux
Output of
bazel --version
: 7.4.0Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file: 2.1.0Language(s) and/or frameworks involved: JavaScript
How to reproduce
pnpm init
pnpm i -D left-pad
(any package)echo 'require("left-pad"); require("fs").writeFileSync("dummy.txt", "");' > index.js
MODULE.bazel
:BUILD.bazel
:"pnpm": {"onlyBuiltDependencies": []}
topackage.json
bazel build repro
. Get the following error:You can remove
dev = True
from thetranslate_lock
call to have it working.Any other information?
The offending line seems to be:
rules_js/npm/private/pnpm.bzl
Line 495 in a829760
The text was updated successfully, but these errors were encountered: