[SOLVED] I Get Error : _ParseUser.default.currentAsync is not a function, when upgrading to Moralis 2.0

Hi, can you help me i just received this error after upgrading to Moralis 2.0
Screenshot_17

i just try to authenticate user with metamask login, is there anyone can help me solve this problem?
thanks!

im using :

  • react-moralis 1.4.1
  • moralis 2.0.1
  • react-script 5.0.1

moralis 2.0 works only in backend, you should use an older version of Moralis SDK in this case

but i just saw the video on youtube that we have to upgrade to Moralis 2.0 before 15th September?

if we can use older version of Moralis, do i just downgrade it or is there any specific way to use it? im just start using moralis for 1 week here so any help will be appreciated. thanks!

where did you see that video that says that you have to upgrade by 15th September?

you just specify an older version of that sdk in order to downgrade, a version below 2.0

do i need to install this package instead https://www.npmjs.com/package/moralis-v1 ?

or just simply npm install [email protected] something like that?

it could depend on what you use, try both options to see what works for you

i try both but i still received this error when i first start my app
Screenshot_18

what type of project do you have, what versions did you use?

i just start implement moralis on my project for a few days, my project is for NFT related things, i only have 2 function moralis in my project for now :

  1. authenticate with metamask
  2. getNativeBalance().

this problem occurred when i received error regarding webpack 5 polyfill issues, and try solved it using react-app-rewired from this solution https://github.com/facebook/create-react-app/issues/11756#issuecomment-1001130053

the problem is solved and my app can running again, but then i received the error above.

before i update to Moralis 2.0 everything just working fine, now i try downgrade it again but i still cant use the function

it should work fine when you downgrade, you may have to downgrade both react-moralis and moralis
you could try versions like this:

from what you say, this should be a react project

oh, you’re right! I forgot I also updated react-moralis, everything is working fine now. thanks for the support! I really appreciated it!

1 Like