Skip to content

When upgrading from 4.3.0 to 4.4.0, using esbuild --bundle to build will report an error Could not resolve "stream" #516

Closed
@leizongmin

Description

@leizongmin

This is an example file test.js:

require('readable-stream');

Run the following commands (esbuild@0.17.12):

esbuild --bundle test.js

It outputs:

✘ [ERROR] Could not resolve "stream"

    node_modules/.pnpm/readable-stream@4.4.0/node_modules/readable-stream/lib/stream/promises.js:7:8:
      7 │ require('stream')
        ╵         ~~~~~~~~

  The package "stream" wasn't found on the file system but is built into node. Are you trying to
  bundle for node? You can use "--platform=node" to do that, which will remove this error.

1 error

If I use version 4.3.0, it will output correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions