Back

TypeError: main() missing 1 required positional argument: 'res'

  • 0
  • Functions
  • Cloud
Prateek Jain
19 Apr, 2024, 15:06

Cloud function is failing. May i know what is this error when function is being deployed. Thanks

TL;DR
Issue: An error message 'TypeError: main() missing 1 required positional argument: 'res'' is occurring in the cloud function deployment. Solution: One potential reason for this error could be that the 'main()' function is missing the required 'res' argument. Ensure that the 'main()' function definition includes 'res' as a positional argument.
Steven
19 Apr, 2024, 15:19

Your function may not be formatted right. How did you make it? What is the code?

Prateek Jain
19 Apr, 2024, 15:31

import json from appwrite.client import Client from appwrite.services.databases import Databases from appwrite.id import ID import os

def main(context): client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') .set_project(os.environ['PROJECT_ID']) .set_key(os.environ['API_KEY']) ) print("hello")

Prateek Jain
19 Apr, 2024, 15:32

like this sir

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