Back

No data being passed to functions called by events or via client

  • 0
  • Functions
  • Cloud
HayHay
10 May, 2024, 23:39

Hey everyone, I'm having an issue where no data is being passed to the appwrite function when an event is called or when the function is executed from the client with data passed into the body (I've ensured it's a post request).

I tried logging the req and res, as well as the env just to test and everything is empty

Code

TypeScript
export default async ({ req, res, error, log }: any) => {
  log("req", req);
  log("res", res);
  log("Bun ENV", Bun.env);

  return res.empty();

Output from logs:

TypeScript
req
res
Bun ENV

I'm using the bun-1.0 runtime, and here is the database event that should (in theory) work: databases.*.collections.*.documents.*.create This is successfully triggering the function, but no data is being passed in. Am I missing something here?

Thanks!

TL;DR
Developers are having an issue where no data is being passed to the appwrite function when called by events or via the client. They've tried logging req and res, but everything is empty. They are using the bun-1.0 runtime. Solution: Check if the data is being passed correctly in the database event `databases.*.collections.*.documents.*.create`, and ensure that the relevant data is being sent along with the request.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more