aspect-build / aspect-build/rules_js

[Bug]: pnpm workspace projects with no `pkg` cause `rdeps` query failures

Open
#1,837 1 comment 0 reactions 0 assignees View on GitHub
bug need: discussion
Dominant language
Starlark
Stars
378
Forks
183
Avg merge
1d 9h
Merged PRs (30d)
32

Description

### What happened?

Some pnpm workspace projects have no `npm_package` target (the name defined by `npm_translate_lock(npm_package_target_name)`) because they are never linked into the package store. Projects such as "apps" are part of the pnpm workspace, have dependencies etc, but will most likely never be depended on so do not have `npm_package` targets. However it seems that target may still be referenced by a target generated by rules_js.

### Version

Language(s) and/or frameworks involved: ts+js

### How to reproduce

```shell
Declare a pnpm workspace, 2 projects, 1 project without an `npm_package`, then run an `rdeps` query such as:

bazel query 'rdeps(//...)'
```

### Any other information?

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the pnpm workspace with two projects, including one without an npm_package target, then run the stated Bazel rdeps(//...) query. Trace the generated rules_js targets and the missing reference; done means the reverse-dependency query completes without failing on a nonexistent target.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.