Is running inside a browser really supported?
mariusk opened this issue · comments
Marius Kjeldahl commented
The docs state that it is, and recommends a builder/bundler etc. I'm using vite, and when importing libauth in an otherwise working project I get:
[vite] ✘ [ERROR] Top-level await is not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari14" + 2 overrides)
[vite] node_modules/@bitauth/libauth/build/lib/crypto/default-crypto-instances.js:6:53:
[vite] 6 │ ... [sha1, sha256, sha512, ripemd160, secp256k1] = await Promise.all([
[vite] ╵ ~~~~~
So is it supporte, and if so, what is needed to get it working?
Kallisti commented
Marius Kjeldahl commented
Thanks, with some messing around with the vite config that works.