Updating moralis and react-moralis in nextjs app throws a TypeError: Right-hand side of 'instanceof' is not callable

Hi everyone,

just updated moralis and react-moralis in my next-js app and I got this error:

Unhandled Runtime Error TypeError: Right-hand side of ‘instanceof’ is not callable

everything was working fine before the update. I also tried creating a brand new next-app but got the same… Just wrapping my app with a MoralisProvider cause the error.

Can you help me on this?

many thanks,

Kim

1 Like

According to this post https://forum.moralis.io/t/the-future-of-the-javascript-sdk/14501/5 I think for react/next.js users it’s better to get back to [email protected] and the normal react-moralis and wait for the moralis-v2 update.

1 Like

For now you can go back to the old versions before 2.0 until this is fixed with Next.js:

[email protected] and [email protected].

2 Likes

thank you for your answer… I’ll do that :ok_hand:

cool… thank you! I should have check before updating :stuck_out_tongue_closed_eyes:

Did it work for you? I had the same exact problem, migrated to moralis-v1, it broke my app, reverted back, but it still doesn’t work.

you reverted back both react-moralis and moralis?

I had to revert to [email protected] as 1.4.0 was throwing same error:

yarn add [email protected] [email protected]

should do the trick.

1 Like

It worked, thanks a lot!