[SOLVED] Moralis v2: TypeError: Moralis.start is not a function

I tried to follow the tutorial on the doc setting up a simple nodeJS app, and I basically copy and paste the code from the doc, and then I got this strange issue saying ’ TypeError: Moralis.start is not a function’ along with another issue ‘bigInt: failed to load bindings, pure JS will be used (try npm run rebuild)’. I did some search but ended up getting no luck, I dont know if it was just me or something, here are the screenshots:


1

btw, the node version is v16.13.0. Thanks in advance.

You can have your Moralis instance as such in nodejs.

const Moralis = require("moralis").default;

Thank you for your reply. The thing is I try both ways, ES module and commonJS, and when I used commonJS import, it just showed an issue of ‘bigInt: Failed to load bindings, pure JS will be used (try npm run rebuild?)’, here is the screen shot:


I was really wondering Am I the only one who came across this issue? and you guys have no problem working with it? what exactly I missed?

Are you following this tutorial?

The final code copied works on my end (and then changing the API key and address) with your same dependencies.

Thank you for your reply. Yep, that’s the tutorial. And it seems like in my case, it just cannot initialize Moralis correctly, according to the nodeJS sdk reference:


and in my index.js, I simply did the same thing:

and also, I even tried to create another moralis account, and used another api key, still got the same issue, so absurd…

Not sure why that’s happening. See this issue with that warning or this one. You can possibly just ignore it.

It does look like your code actually works e.g. in the second screenshot you posted, it says your Express server is running. And in your the last block of code that only uses Moralis.start, nothing will happen or display in console - this is expected.

1 Like

Are you using nodejs, typescript, a module, something else?
There could be a different syntax in every case.

Thank you very much for your reply. Based on the links you shared, I can see that it does seem like there’s nothing we should or need to do on our side. And also I think you are right, this bigInt issue does not crash the code, it’s more like an annoying warning. But still, if I switch to the ES module import, then this ‘TypeError: Moralis.start is not a function’ bug shows up and crash the code.
Anyways I think I’ll just stick with commonJS import for now and see what happens in the future. So, thanks again for your help!

Thank you for your reply. Well, I simply just wanna tryout the new version of the Moralis SDK, so I just followed the tutorial, and didn’t bother using typescript or other stuff, as you can see the screenshots I posted earlier, nothing extra in the depedencies. However I did notice something that may cause the bug “Moralis.start is not a function”, when I use ES module import:


I got the warning of bigInt as well as the error ‘moralis.start is not a function’ :

then, I hover over the start property, I see this:

according to the declaration of ‘start’, it is supposed to be a method or function not a property, right? If I got it wrong, then I really have no idea why the compile yelling at me about this error…

You can check this thread:

It should have the response for every case, nodejs or module.

1 Like

Thank you so much for the solution. It did help me get rid of the error, but seems the price is IntelliSense is not able to show me suggestions on the “Moralis2”, I know it may not be a big deal, still hope the Moralis devs could fix this later. Lastly, thanks again, appreciate it!

2 Likes