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

[Bug]: pnpm v9 lockfile issues for frontend examples #464

Open
dkthezero opened this issue Jun 7, 2024 · 0 comments
Open

[Bug]: pnpm v9 lockfile issues for frontend examples #464

dkthezero opened this issue Jun 7, 2024 · 0 comments

Comments

@dkthezero
Copy link

Reproduce:

  • Install pnpm v9.2.0
  • Remove pnpm-lock.yaml
  • Run pnpm install
  • Run pnpm run build

Then the error occur:

Repository rule npm_translate_lock_rule defined at:
  /private/var/tmp/_bazel_dkthezero/f3a599e6e224858962c4e41ca1d729db/external/aspect_rules_js~/npm/private/npm_translate_lock.bzl:145:42: in <toplevel>
ERROR: An error occurred during the fetch of repository 'aspect_rules_js~~npm~npm':
   Traceback (most recent call last):
        File "/private/var/tmp/_bazel_dkthezero/f3a599e6e224858962c4e41ca1d729db/external/aspect_rules_js~/npm/private/npm_translate_lock.bzl", line 117, column 45, in _npm_translate_lock_impl
                helpers.verify_lifecycle_hooks_specified(rctx, state)
        File "/private/var/tmp/_bazel_dkthezero/f3a599e6e224858962c4e41ca1d729db/external/aspect_rules_js~/npm/private/npm_translate_lock_helpers.bzl", line 585, column 13, in _verify_lifecycle_hooks_specified
                fail("""\
Error in fail: ERROR: pnpm.onlyBuiltDependencies required in pnpm workspace root package.json when using pnpm v9 or later

As of pnpm v9, the lockfile no longer specifies if packages have lifecycle hooks.

Packages that rules_js should generate lifecycle hook actions for must now be declared in
pnpm.onlyBuiltDependencies in the pnpm workspace root package.json. See
https://pnpm.io/package_json#pnpmonlybuiltdependencies for more information.

Prior to pnpm v9, rules_js keyed off of the requiresBuild attribute in the pnpm lock
file to determine if a lifecycle hook action should be generated for an npm package.
See [pnpm #7707](https://github.com/pnpm/pnpm/issues/7707) for the reasons that pnpm
removed the requiredBuild attribute from the lockfile in v9.

Fix: Downgrade the pnpm to v8.15.8.
Expectation: can run with pnpm v9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant