aspect-build / rules_esbuild

Bazel rules for https://esbuild.github.io/ JS bundler
https://docs.aspect.build/rules/aspect_rules_esbuild
Apache License 2.0
27 stars 27 forks source link

[Bug]: Upgrading from v0.16.0 to v0.18.0 causes non-browser scripts to throw an error #194

Open BillyBlaze opened 8 months ago

BillyBlaze commented 8 months ago

What happened?

I am upgrading aspect_rules_esbuild from version v0.16.0 to v0.18.0. Everything is working in v16 however in v18 I am getting the following errors from esbuild. (I couldn't check v0.17.0 because its not in the bazel registry)

✘ [ERROR] Could not read from file: /.../bin/node_modules/.aspect_rules_js/object-inspect@1.13.1/node_modules/object-inspect/util.inspect

    node_modules/.aspect_rules_js/object-inspect@1.13.1/node_modules/object-inspect/index.js:68:26:
      68 │ var utilInspect = require('./util.inspect');`

This happens because the object-inspect main file is requiring the file that is marked as non-browser.

This dependency is sadly commonly used in multiple packages such as react-dev-utils, cypress or webpack

Version

Development (host) and target OS/architectures: Linux 5.15.146.1-microsoft-standard-WSL2 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Output of bazel --version: bazel 7.0.2

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

Language(s) and/or frameworks involved: pnpm

How to reproduce

No response

Any other information?

No response