Moralis Error v1.1.0

InternalWeb3Provider.js?d168:134 Uncaught (in promise) TypeError: Cannot read properties of null (reading ‘on’)
at InternalWeb3Provider.eval (webpack-internal:///./node_modules/moralis/lib/browser/InternalWeb3Provider.js:134:36)
at tryCatch (webpack-internal:///./node_modules/regenerator-runtime/runtime.js:45:40)
at Generator.invoke [as _invoke] (webpack-internal:///./node_modules/regenerator-runtime/runtime.js:274:22)
at Generator.prototype. [as next] (webpack-internal:///./node_modules/regenerator-runtime/runtime.js:97:21)
at asyncGeneratorStep (webpack-internal:///./node_modules/@babel/runtime-corejs3/helpers/asyncToGenerator.js:5:24)
at _next (webpack-internal:///./node_modules/@babel/runtime-corejs3/helpers/asyncToGenerator.js:27:9)

I receive this error and i can’t figure out how to solve it . I’m using next.js and react-moralis.

maybe this thread can help you: Moralis JS-SDK v1.0.0 [beta] (Ethers.js support)

I did this :

import Web3 from “web3”; // Only when using npm/yarn

Moralis.start({
serverUrl: “YOUR_SERVER_URL”,
appId: “YOUR_APP_ID”,
web3Library: Web3,
});
// Get the initialized web3 instance from Web3.js
await Moralis.enableWeb3();
const web3 = Moralis.web3;

Still does not work.

import { MoralisProvider } from "react-moralis";

import { Moralis } from "moralis";

import Web3 from "web3";

function MyApp({ Component, pageProps }) {

  const serverURL = process.env.NEXT_PUBLIC_SERVERURL;

  const appID = process.env.NEXT_PUBLIC_APPID;

  Moralis.start({

    serverUrl:serverURL,

    appId:appID,

    web3Library: Web3,

  })

  return (

    <MoralisProvider appId={appID} serverUrl={serverURL}>

      <div className="containerBlack">

        <Component {...pageProps} />

      </div>

    </MoralisProvider>

  );

}

export default MyApp;
1 Like

I don’t know, you could use the previous version before this update (0.0.184) if you want