I am having a hard time setting up the Web3API on my self-hosted parse server. I built this very simple function to test, and I am getting the following error:
MoralisError [Moralis SDK Core Error]: [C0008] Default instance of Core is not set
at Function.CoreProvider.getDefault (parse-server/node_modules/@moralisweb3/common-evm-utils/node_modules/@moralisweb3/common-core/lib/CoreProvider.js:10:19)
at Function.EvmChain.create (parse-server/node_modules/@moralisweb3/common-evm-utils/lib/dataTypes/EvmChain/EvmChain.js:201:52)
at Function.get (parse-server/node_modules/@moralisweb3/common-evm-utils/lib/dataTypes/EvmChain/EvmChain.js:63:29)
at parse-server/build/cloud/getFunctions.js:307:48
at parse-server/node_modules/parse-server/lib/Routers/FunctionsRouter.js:173:16
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
isMoralisError: true,
code: 'C0008',
details: undefined,
[cause]: undefined
}
Parse.Cloud.define("getUserCollection", async (request: any) => {
try {
const response = await Moralis.EvmApi.nft.getWalletNFTs({
address: request.params.address,
chain: EvmChain.POLYGON,
});
console.log(response);
} catch (e) {
console.error(e);
}
});
Dependencies:
"@moralisweb3/common-core": "^2.10.3",
"@moralisweb3/common-evm-utils": "^2.11.1",
"@moralisweb3/parse-server": "2.10.3",
"moralis": "^2.10.3",