Patrick Collins
Patrick Collins

Reputation: 6131

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

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?

Upvotes: 1

Views: 544

Answers (2)

Yomoo
Yomoo

Reputation: 218

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

Upvotes: 1

Patrick Collins
Patrick Collins

Reputation: 6131

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.

Upvotes: 1

Related Questions