Skip to content

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

Description

@BillyBlaze

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:

  • aspect_rules_esbuild @ 0.18.0
  • aspect_rules_js @ 1.38.0

Language(s) and/or frameworks involved:
pnpm

How to reproduce

No response

Any other information?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneed: more infoThe issue isn't clear as written

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions