-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Bug Report: New functions are not created with the new structure 1.4.2. #6186
Comments
@criihz, thanks for creating this issue! 🙏🏼 How exactly are you using the CLI? We don't have a working version of the CLI for Appwrite 1.4 yet 🧐 |
I am currently running the following:
And this I understand that the function creates for me with the previous version of the server 1.3.x. But I am using the CLI version 3.0.0 with setting to create and deploy the function, I understand that this CLI is not generating the function with the new structure. Take the example found in the documentation and update my function, add the compile command "pip install -r .....txt" and run the function, but it still gives me an error:
This is my code function: from appwrite.client import Client
import os
# This is your Appwrite function
# It's executed each time we get a request
def main(context):
# Why not try the Appwrite SDK?
#
# client = (
# Client()
# .set_endpoint("https://cloud.appwrite.io/v1")
# .set_project(os.environ["APPWRITE_FUNCTION_PROJECT_ID"])
# .set_key(os.environ["APPWRITE_API_KEY"])
# )
# You can log messages to the console
context.log("Hello, Logs!")
# If something goes wrong, log an error
context.error("Hello, Errors!")
# The `context.req` object contains the request data
if context.req.method == "GET":
# Send a response with the res object helpers
# `context.res.send()` dispatches a string back to the client
return context.res.send("Hello, World!")
# `context.res.json()` is a handy helper for sending JSON
return context.res.json({
"motto": "Build Fast. Scale Big. All in One Place.",
"learn": "https://appwrite.io/docs",
"connect": "https://appwrite.io/discord",
"getInspired": "https://builtwith.appwrite.io",
}) |
The CLI doesn't work yet so I'm not sure if using it is a good idea. Anyways, you might want to make sure the entrypoint in your function settings matches what the path of the code is. |
@stnguyen90 Thanks, You are right, apparently the template that is used is not yet updated and the ones generated from the previous version do not work correctly, I tried with several entry points and I still cannot get the function to execute correctly. |
@Kriihz77, btw, version 4.0.0 of the CLI has been released and should use the new templates correctly. |
👟 Reproduction steps
Through the CLI, a function was created in Python 3.10, and it created the old structure of the functions and not the new one proposed for version 1.4.x.
👍 Expected behavior
👎 Actual Behavior
additional, an error is being generated when consuming the import
🎲 Appwrite version
Version 1.4.x
💻 Operating system
Linux
🧱 Your Environment
1.4.2 and CLI 3.0.0 Branch Master
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: