Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esbuild-wasm is now erroring out from missing builtin node packages on the web #2105

okikio opened this issue Mar 15, 2022 · 4 comments


Copy link

okikio commented Mar 15, 2022


esbuild-wasm uses "fs", "crypto", etc... in the source code, but those packages can't be bundled and sent to the web so trying to use bundle esbuild-wasm for the web keeps failing, this specifically only occurs in versions >=v0.14.26 that includes the latest version as of this post v0.14.27.

You can replicate this issue here:

# Run 
npm run build

The error should appear.

Copy link

hyrious commented Mar 18, 2022

This might be a regression of #2081 that moves code including require("fs") from a string (will be evaluated by Function()) to outside.

We can try to wrap these code in a try-catch so that esbuild won't complain about these require calls.

Copy link

okikio commented Mar 18, 2022

I hope that the problem is fixed

Copy link

evanw commented Mar 25, 2022

I believe this was accidentally fixed by me upgrading to Go 1.18.0, which separated out node-related stuff into another file: golang/go@680caf1. So this should be fixed in the upcoming release of esbuild.

@evanw evanw closed this as completed Mar 25, 2022
evanw added a commit that referenced this issue Mar 25, 2022
Copy link

okikio commented Mar 25, 2022


zhusjfaker pushed a commit to speedy-js/esbuild that referenced this issue Mar 28, 2022
hardfist pushed a commit to speedy-js/esbuild that referenced this issue Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

3 participants