Home > Software design >  Unhandled Rejection (TypeError): moralis__WEBPACK_IMPORTED_MODULE_1__.Moralis.start is not a functio
Unhandled Rejection (TypeError): moralis__WEBPACK_IMPORTED_MODULE_1__.Moralis.start is not a functio

Time:10-16

I'm getting:

Unhandled Rejection (TypeError): moralis__WEBPACK_IMPORTED_MODULE_1__.Moralis.start is not a function

In my front end, I'm using the react-moralis framework.

(anonymous function)
src/hooks/useMoralis/_useMoralisIntit.ts:41
  38 |   }
  39 | 
  40 |   setIsInitializing(true);
> 41 |   await Moralis.start({ serverUrl, appId });
     | ^  42 |   setIsInitializing(false);
  43 |   setIsInitialized(true);
  44 | },

The code worked on 0.2.3 but breaking on 0.2.6, what's going on?

CodePudding user response:

The Moralis.start piece was added in a recent release of moralis, so it's likely you are using packages that are out of sync.

You need to update both react-moralis and moralis

yarn add react-moralis moralis

This will update both to the latest edition.

CodePudding user response:

It’s a new function and react-moralis is using the Moralis version that you have installed. You need to update moralis to version >0.0.92

  • Related