You need to call Moralis.start with an applicationId before using Moralis

I am using Ethereum-boilerplate. In my react-app “MoralisProvider” is already initialized with ServerUrl and AppId into index.js. Everything was working fine until I created a component where I used Moralis for data fetching from server. Now, the problem is whenever I render the new component I got this error.

Uncaught (in promise) Error: You need to call Moralis.start with an applicationId before using Moralis.
    at Object.generatePath (Storage.js:142:1)
    at Object.currentInstallationId (InstallationController.js:32:1)
    at Object.request (RESTController.js:387:1)
    at Object.find (ParseQuery.js:3073:1)
    at ParseQuery.value (ParseQuery.js:852:1)
    at balanceUpdate (HorseRacing.jsx:268:1)
    at HorseRacing (HorseRacing.jsx:273:1)
    at renderWithHooks (react-dom.development.js:14985:1)
    at mountIndeterminateComponent (react-dom.development.js:17883:1)
    at beginWork (react-dom.development.js:19049:1)

Even after the error, the database is working perfectly. But the execution of the code interrupts.

How did you import Moralis in that component?

      <MoralisProvider appId={APP_ID} serverUrl={SERVER_URL}>
        <App isServerInfo />
      </MoralisProvider>

This code is written into index.js

What you’re doing in the component actually caused the issue which you can delay the process with isInitialized which you get from useMoralis(). const { isInitialized } = useMoralis() or you can try do it in another way.

1 Like