Unhandled Rejection (TypeError): Moralis.start is not a function — Moralis version 0.6.08 doesn't fix it

Hi! Someone already shared this error; however, I am getting the same error, updated moralis in package.json to “moralis”: “0.6.08” and this didn’t fix the issue:

is someone able to help me with this issue?

Here is my index.js file

import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import { MoralisProvider } from "react-moralis";
// import reportWebVitals from './reportWebVitals';

ReactDOM.render(
  // <React.StrictMode>
  <MoralisProvider 
    appId="XXXXXXXXXX" 
    serverUrl="XXXXXXXXXX">
    <App />
  </MoralisProvider>,
  // </React.StrictMode>,
  document.getElementById('root')
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
// reportWebVitals();

Here is my package.json dependencies:

...
"dependencies": {
    "@emotion/react": "^11.4.1",
    "@emotion/styled": "^11.3.0",
    "@fortawesome/fontawesome-free": "^5.15.4",
    "@fortawesome/fontawesome-svg-core": "^1.2.36",
    "@fortawesome/free-solid-svg-icons": "^5.15.4",
    "@fortawesome/react-fontawesome": "^0.1.15",
    "@material-ui/core": "^4.12.3",
    "@mui/icons-material": "^5.0.1",
    "@mui/material": "^5.0.2",
    "@nomiclabs/hardhat-ethers": "^2.0.2",
    "@nomiclabs/hardhat-waffle": "^2.0.1",
    "@openzeppelin/contracts": "^4.3.2",
    "@skalenetwork/ima-js": "^0.1.0",
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "@typeform/embed-react": "^1.1.2",
    "@walletconnect/web3-provider": "^1.6.5",
    "axios": "^0.22.0",
    "chai": "^4.3.4",
    "ethereum-waffle": "^3.4.0",
    "ethers": "^5.4.7",
    "hardhat": "^2.6.5",
    "html5-file-selector": "^2.1.0",
    "moralis": "^0.0.60",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-dropzone": "^11.4.2",
    "react-dropzone-uploader": "^2.11.0",
    "react-moralis": "^0.2.4",
    "react-router-dom": "^5.3.0",
    "react-scripts": "4.0.3",
    "react-scroll": "^1.8.4",
    "styled-components": "^5.3.1",
    "web-vitals": "^1.0.1",
    "web3modal": "^1.9.4"
  },
...

Also, if this is helpful, my authentication function to login with Metamask (that works in another project 100%) is returning this error message:

You need to call Parse.initialize before using Parse.

I would think it maybe has to do with the server? But I am not sure…

Please try updating the npm package and try running it. The latest versions would look like this -

    "moralis": "^0.0.88",
    "react-moralis": "^0.2.6",

Let us know once updated.

Thanks

1 Like

Life saver! Thank you so much @malik!!! You rock.

I do have a random question — I use this “outdated” version of Moralis in another project and it works 100% fine. Is there a reason why it would work in an app I shipped last week, but not for a new project I started this week?

1 Like

There was an update on Moralis sdk starting with version 0.0.80 that added the syntax with Moralis.start and removed the previous syntax to set server url and application id.

1 Like

Gotcha, thanks so much, @cryptokid! Really appreciate the explanation, cheers!