[SOLVED] TypeError: Right-hand side of 'instanceof' is not callable

I am getting a following error: TypeError: Right-hand side of ‘instanceof’ is not callable.

My deps:

  "dependencies": {
    "moralis": "1.11.0",
    "next": "12.1.5",
    "react": "18.1.0",
    "react-dom": "18.1.0",
    "react-moralis": "^1.4.1",
    "web3uikit": "^0.0.133",
    "magic-sdk": "^9.0.0"

I already tried this. If I revert versions of react-moralis, I will get a this problem.
And I also tried to fix it, but nothing works. Please help

You could try exact versions

did not help

Unhandled Runtime Error

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

You trie with different versions?

If I use different versions (for example: react-moralis1.3.5), I get this error:
NoMoralisContextProviderError: Make sure to only call useMoralis within a MoralisProvider

This error, seems strange, what type of project you have? react, nextjs, something else?

Nextjs and React, thats it

Hi, that error is coming from web3uikit. I’ll try to contact the maintainer to see if they can fix it from their side. You still can use @web3uikit/core and @web3uikit/icons but unfortunately @web3uikit/web3 use react-moralis and for some reason is not working anymore. For now i guess you need to create your custom button and handle the connection through react-moralis yourself.


Thank you!!! I removed web3uikit and it worked fine

1 Like

You’re welcome. opened an issue on github repo.

1 Like

downgrading to moralis@1.8.0 [email protected] fixed it for my next.js react project


this worked for me!!

Hi, can you share your whole package.json file?