Hello.
I am trying to call one of my moralis cloud function from a firebase cloud function.
I have the following code :
const Moralis = require("moralis").default;
...
exports.testCloudfunction = functions.https.onCall(async (data, context) => {
...
await Moralis.start({
apiKey: moralisKey,
});
const checkCode = await Moralis.Cloud.run("checkGiftCode",{
code:giftCode,
wallet:claimAddress
});
...
which is what i found in every docs and exemples i found, but i get the following error :
Unhandled error TypeError: Cannot read properties of undefined (reading ‘run’) at /workspace/index.js:275:39 at async /workspace/node_modules/firebase-functions/lib/common/providers/https.js:407:26
So moralis.Cloud is undefined.
What am I doing wrong?
Thanks