I have a problem with async appwrite function. I use context in my main function and i call function from query_by_location_id file. However, i got the error. Does anyone have solution for the async function solution? Thank you.
Hello, Errors! Traceback (most recent call last): File "/usr/local/server/src/server.py", line 163, in action output = await asyncio.wait_for(execute(context), timeout=safeTimeout) File "/usr/local/lib/python3.9/asyncio/tasks.py", line 479, in wait_for return fut.result() File "/usr/local/server/src/server.py", line 154, in execute output = await userModule.main(context) File "/usr/local/server/src/function/main.py", line 51, in main return context.res.json( File "/usr/local/server/src/server.py", line 25, in json return self.send(json.dumps(obj, separators=(',', ':')), statusCode, headers) File "/usr/local/lib/python3.9/json/init.py", line 234, in dumps return cls( File "/usr/local/lib/python3.9/json/encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) File "/usr/local/lib/python3.9/json/encoder.py", line 257, in iterencode return _iterencode(o, 0) File "/usr/local/lib/python3.9/json/encoder.py", line 179, in default raise TypeError(f'Object of type {o.class.name} ' TypeError: Object of type coroutine is not JSON serializable
You're trying to return something that isn't JSON serializable
Ya. That list_document()
Or rather, query_by_location_id(location_id)
Recommended threads
- Bug in relational table
I potential found a bug or is there something I am missing? I created 2 tables. User and Coins User has a one to one relation to Coins When attempting to cre...
- Server API Key
Hi, I have a self-hosted Appwrite instance and I can’t quite figure out how to create a server-side API that lets me automate the creation of projects. The only...
- Locked out of account
Hey guys, I have a paid account and have been locked out. Apologies for using this method, but I'm getting no response via the contact us page. I had a old do...