[SOLVED] Cloud function argument is empty

My cloud function looks like:

Moralis.Cloud.define("myCloudFunc", async (request) => {
	const logger = Moralis.Cloud.getLogger();
	logger.info('request', request)

I called it with
await Moralis.Cloud.run("myCloudFunc", {x: 1, y: 2, color: 3})

The log output looks like:

  INFO  || 2022-04-21 12:44:54  

  INFO  || 2022-04-21 12:44:54  
Ran cloud function myCloudFunc for user Tcbj0RQCKdn3E6IBTHgqXtKP with:
  Input: {"x":1,"y":2,"color":3}
  Result: undefined

Clearly, the cloud function is called with the correct arguments, but the argument request is empty

replace this with:
logger.info('request' + JSON.stringify(request))

Thanks. It works! :rofl: :rofl: :rofl: :rofl:

1 Like