MoralisWeb3 / Moralis-JS-SDK

Moralis Official Javascript SDK
https://docs.moralis.io
Other
366 stars 257 forks source link

Moralis.authenticate() is error #124

Closed Breathe-97 closed 2 years ago

Breathe-97 commented 2 years ago

I use it on vue. Example: import Moralis from 'moralis/dist/moralis.min.js'; if you use api: Moralis.authenticate() errmsg is : Uncaught (in promise) TypeError: t2 is not a constructor So.I tryit import Moralis from 'moralis/dist/moralis.js' use api:Moralis.authenticate() errmsg is : Uncaught (in promise) TypeError: MWeb3 is not a constructor I don't know why.But I want to get help with feedback. Thanks.

Breathe-97 commented 2 years ago

I found the cause. I think moralis can automatically introduce web3 But actually I need to introduce it separately So

And import moralis from 'moralis/dist/moralis.min.js' Then it's normal.

ErnoW commented 2 years ago

Yes, that is correct, you need to provide the web3 library manually. This is expected behavior. Glad that you figured it out. Happy buidling