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

Bundling with esbuild fails because of require('stream') and require('crypto') #70

Open
stijlist opened this issue Oct 5, 2022 · 3 comments

Comments

@stijlist
Copy link

stijlist commented Oct 5, 2022

No description provided.

@stijlist
Copy link
Author

stijlist commented Oct 5, 2022

My apologies, accidentally hit enter in the middle of typing my comment.

I filed anza-xyz/wallet-adapter#584 against @solana/wallet-adapter - you can run esbuild index.tsx --bundle --sourcemap --outfile=src/assets/index.js on the gist I've included below and then run npm ls cipher-base and npm ls @toruslabs/eccrypto to see that Torus is the dependency causing the resolution errors.

https://gist.github.com/stijlist/174b3b3c8bc6e4d009826c8a13a7e661

@stijlist stijlist changed the title Bundling with esbuild fails because of `require('stream')1 Bundling with esbuild fails because of require('stream') and require('crypto') Oct 5, 2022
@metallicalfa2
Copy link
Contributor

@ieow @guru-web3

@chaitanyapotti
Copy link
Member

As a library, we don't polyfill the dependencies on the default esm, cjs builds.
this is to prevent double polyfilling by webpack/rollup/esbuild incase you're using other deps which require polyfilling (which is often the case)

We also provide umd build which is polyfilled and can be used as a script tag in your application.

Here are some cases on how to polyfill: https://web3auth.io/docs/troubleshooting/webpack-issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants