metaplex-foundation / js

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

Can't seem to use it on Vite+vue app #214

Closed jiangxia closed 2 years ago

jiangxia commented 2 years ago

I have an urgent project

I installed the library on an existing vue app with

npm create vite@latest getting-started-vite -- --template vue cd getting-started-vite npm install

And initialize it with const metaplex = new Metaplex(connection);

I have reference to this document to operate: https://github.com/metaplex-foundation/js-examples/tree/main/getting-started-vite

Without doing anything else, when I load the page where I import the package, I get this runtime error:

index.7b42bd6d.js:149 Uncaught TypeError: Class extends value undefined is not a constructor or null at index.7b42bd6d.js:149:88116 at requireAccount_multisig (index.7b42bd6d.js:149:95207) at index.7b42bd6d.js:149:108535 at requireCommonIndex (index.7b42bd6d.js:149:109599) at requireRpc_errors (index.7b42bd6d.js:148:20186) at index.7b42bd6d.js:148:22470 at requireJsonRpcProvider (index.7b42bd6d.js:149:7221) at index.7b42bd6d.js:149:7891 at requireProviders (index.7b42bd6d.js:149:8200) at requireAccount (index.7b42bd6d.js:149:71417)

I tried ts and js,have the same problem

This problem is inevitable,can you help me

thank you very much

jiangxia commented 2 years ago

The vite version breaks through, and it can be reduced to 2.9.5