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]: updates to pnpm-lock.yaml are not detected #2070

Closed
leungster opened this issue Jan 15, 2025 · 0 comments
Closed

[Bug]: updates to pnpm-lock.yaml are not detected #2070

leungster opened this issue Jan 15, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@leungster
Copy link

leungster commented Jan 15, 2025

What happened?

We're manually updating the pnpm-lock.yaml file using bazel run -- @pnpm//:pnpm --dir $PWD install --lockfile-only and setting update_pnpm_lock = False.

In this setup, changes to the pnpm-lock.yaml file do not trigger a re-fetch of node modules. This results in missing link errors and requires running bazel clean --expunge to resync node_modules locally.

Version

Development (host) and target OS/architectures:
Mac M1

Output of bazel --version:

bazel 8.0.0

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:

bazel_dep(
    name = "aspect_rules_js",
    version = "2.1.2",
)

Language(s) and/or frameworks involved:

How to reproduce

Setup `npm_translate_lock` as such


npm.npm_translate_lock(
    name = "npm",
    bins = {
        "typescript": [
            "tsc=./bin/tsc",
            "tsserver=./bin/tsserver",
        ],
    },
    generate_bzl_library_targets = True,
    npm_package_target_name = "{dirname}",
    npmrc = "//:.npmrc",
    pnpm_lock = "//:pnpm-lock.yaml",
    update_pnpm_lock = False,
    verify_node_modules_ignored = "//:.bazelignore",
)


1. Run `bazel query` on a `node_modules` dependency in an artifact. Make note of the version for that 
dependency.
2. Bump the version of the dependency and call `bazel run -- @pnpm//:pnpm --dir $PWD install --lockfile-only` to update the lock file
3. Run `bazel query` and see if the dependency version matches package.json.

Any other information?

I believe it's due to --incompatible_no_implicit_watch_label being true in Bazel 8.
The pnpm lock file attribute isn't watched for changes.

@leungster leungster added the bug Something isn't working label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant