metaplex-foundation / js

A JavaScript SDK for interacting with Metaplex's programs
357 stars 182 forks source link

Incompatibility with ES2020 BN #155

Closed kevinrodriguez-io closed 2 years ago

kevinrodriguez-io commented 2 years ago

ERROR: Big integer literals are not available in the configured target environment (using VITE) ("chrome87", "edge88", "es2019", "firefox78", "safari13.1").

Which seems to be caused by transitive dep: noble-ed25519 used by arbundles

lorisleiva commented 2 years ago

Hi there 👋

Did you follow this tutorial to get started with Vite, using the right polyfills?

https://github.com/metaplex-foundation/js-examples/tree/main/getting-started-vite

kevinrodriguez-io commented 2 years ago

Hi @lorisleiva Thanks a lot for this. IT WORKS 🚀.

laurensV commented 2 years ago

I am trying to get this to work for nuxt3 (vue) which is also using vite and nitro as a server processor. While it does work with the right polyfills for vite in nuxt development mode (nuxt dev) it doesn't work when I try to build it for production (nuxt build). Its failing in nitro it seems somewhere. Do I also need to change some of the nitro config @lorisleiva ?

ℹ Initializing prerenderer                                                                                   nitro 17:58:33

 ERROR  Rollup error: Transform failed with 93 errors:                                                       nitro 17:58:42
/metaplex/.nuxt/dist/server/index.592e07a8.js:31:12096: ERROR: Big integer literals are not available in the configured target environment ("es2019")