aspect-build / aspect-build/rules_js

[Bug]: Cannot resolve peer dependency at runtime

Open
#1,441 0 comments 0 reactions 1 assignee Claimed by @gregmagolan View on GitHub
bug help wanted need: funding
Dominant language
Starlark
Stars
378
Forks
183
Avg merge
1d 9h
Merged PRs (30d)
32

Description

### What happened?

In order for certain applications like `eslint` and `prettier` to resolve plugins, you have to run `pnpm install` in order for them to be able to find them.

### Version

bazel 7.0.0
WORKSPACE

### How to reproduce

```shell
This came up on https://github.com/aspect-build/rules_lint/pull/53 where Alex discussed the issue:

> you must pnpm i in the source folder, in order for eslint to resolve its plugins like @typescript-eslint/parser. We already had to declare a proper js_library(name="eslintrc") but this doesn't use it since you just bazel run the bare eslint binary.

I've tried installing the plugins using `peerDependencies` via pnpm and `public_host_packages` with Bazel, but in both those cases the plugins only get resolved if I run `bazel run -- @pnpm//:pnpm --dir "$PWD" install` first.
```

### Any other information?

Additional discussion in this Slack thread: https://bazelbuild.slack.com/archives/CEZUUKQ6P/p1699897608787459

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.