Cloud returning Error: Could not find provider

I’m having an issue with the Cloud functions. I’ve distilled it down and it appears that web3 is not getting enabled. What am I doing wrong here? This is a new Moralis server I just created tonight… I do not see this issue on an older test server I have.

I’ve created a simple test function to demonstrate the error

Moralis.Cloud.define('testWeb3', async (request) => {
	const web3 = Moralis.web3ByChain("0x1");
	return {version: web3.version}

and I call it with the following

try {
	cloud = await'testWeb3');
	console.log("test returned:", cloud);
} catch (error) {

and this results in

Error: Could not find provider
    at handleError (moralis.js:26097:17)
    at async main.js:1484:12
    at async HTMLDocument.<anonymous> (main.js:1474:3)

what is the server url? also, that syntax will work only if you selected ETH as the EVM and if the server is on mainnet.

[Moralis server url removed]

this server seems to be on testnet, in this case you can still use a syntax like this:

web3 = new Moralis.Web3(new Moralis.Web3.providers.HttpProvider(""));

Thanks, yes it’s on a test net… I guess that’s a change from the old to the new… I don’t specifically need mainnet, I just need a web3 handle so I can validate a signature and sign a response message. So I was just selecting mainnet as a default.

ok, than you can use an ID specific to an EVM that you have on that server as parameter instead of 0x1 that is for eth mainnet

yep, that’s what I did. I just need to remember to change it when I deploy now… not a big deal… thanks