reactjsnext.jsenvironment-variablestypeerrormoralis

MoralisProvider not Working(TypeError: Right-hand side of 'instanceof' is not callable)


moralisprovider is not working in Next.js

 import { MoralisProvider } from 'react-moralis' 
    function MyApp({ Component, pageProps }) 
     {   return (
        <MoralisProvider
        serverUrl={process.env.NEXT_PUBLIC_MORALIS_SERVER}
        appId={process.env.NEXT_PUBLIC_MORALIS_APP_ID}
        >
          <Component {...pageProps} />
        </MoralisProvider>
        ) } 
    export default MyApp

It says that typererror why it is not working?

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

Solution

  • Try downgrading your moralis SDKs version to moralis@1.8.0 react-moralis@1.4.0

    Reference: https://forum.moralis.io/t/solved-typeerror-right-hand-side-of-instanceof-is-not-callable/18621/10