joshstevens19 / simple-uniswap-sdk

Uniswap SDK which handles the routes automatically for you, changes in trade quotes reactive subscriptions, exposure to formatted easy to understand information, bringing back the best trade quotes automatically, generating transactions for you and much more.
MIT License
188 stars 95 forks source link

Can't use with vite #37

Closed ihamzapped closed 2 years ago

ihamzapped commented 2 years ago

In a vue + ts + vite setup, importing this module gives the following error:

Module "stream" has been externalized for browser compatibility and cannot be accessed in client code.

joshstevens19 commented 2 years ago

you will need to use webpack to bundle it to turn it into browser code, also if you google your error you find a few answers!

out of scope for the project to bundle this in a way for you.. that's down to the app using it (angular, vue, react do this for you automatically so I'm guessing it is a simple thing to handle when using vite)

let me know if you get it to work