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 is not working out of the box. #28

Closed
nonken opened this issue Apr 17, 2021 · 2 comments
Closed

esbuild is not working out of the box. #28

nonken opened this issue Apr 17, 2021 · 2 comments

Comments

@nonken
Copy link

nonken commented Apr 17, 2021

I have a simple client.js

import Wallet from '@project-serum/sol-wallet-adapter';

And create a bundle using

esbuild ./client.js --bundle --outfile=./build/js/client.js

When including the bundled file on a simple page I am getting a bunch of bundling issues and can not use the output bundle.

Uncaught ReferenceError: process is not defined
@nonken
Copy link
Author

nonken commented Apr 17, 2021

The issue is in the secp256k1 dependency which uses elliptic in the browser. When requiring elliptic directly in https://github.com/solana-labs/solana-web3.js/blob/171c73ee938c2bd12f0a0785e52d076c3f58649d/src/secp256k1-program.ts#L3 the build passes and I can connect to the wallet.

@nonken
Copy link
Author

nonken commented Apr 17, 2021

I have opened a new issue here solana-labs/solana-web3.js#1025

@nonken nonken closed this as completed Apr 17, 2021
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

1 participant