#[SOLVED] Error Deployments
1 messages · Page 1 of 1 (latest)
void main(List<String > args) {
print( "Hello World, I'm an Appwrite cloud function written in Dart.");
}
You'll need to structure your code a certain way for functions. Please follow the docs: https://appwrite.io/docs/functions
Btw, it's best to use 3 back ticks with multi-line code. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting
I am using this example is it not correct?
No, that is outdated. The repo is archived and the readme says
Warning - the functions in this repo were designed for Appwrite versions 0.7.0 to 0.12.4. For Appwrite version 0.13.0 and above, please refer to the Open Runtimes Function Examples.
No, please follow the docs: https://appwrite.io/docs/functions
I tried this example it doesn't deploy too with the same error
What exactly did you do?
Navigate to the function you want to deploy.
Click Create deployment.
Select the Manual tab.
Input the entry point of your function under Entrypoint. For the example above, it would be main.dart.
Upload code.tar.gz.
Select Activate deployment after build to use your new function.
Click Create to deploy your function.
Please do this instead: https://appwrite.io/docs/functions#gettingStarted
I create the function on one machine and appwrite on another, I thought for such cases manual deployment
Nope the Appwrite CLI can be used from anywhere
as it is installed, but it is not on this machine
Then install the Appwrite CLI
it doesn't work?
It does, if you do a lot of other steps correctly. The CLI helps make sure things are done correctly because it does it automatically for you
Steps like writing the function correctly and tar'ing it correctly
And, for emphasis, I mean to install the Appwrite CLI, and not Appwrite itself
appwrite cli installed installed on the machine with appwrite
everything is very confusing
I expected a simple installation, not a quest)
As I said, you can install the Appwrite CLI locally where you're writing your function
It is simple...if you use the CLI
And again, your code was incorrect. It was not written as described in the docs: https://appwrite.io/docs/functions#writingYourOwnFunction
appwrite functions createDeployment --functionId=64ece25fa712e9afa728 --entrypoint='main.dart' --code="." --activate=true
ℹ Info Ignoring files using configuration from appwrite.json
$id : 64ece38205948a35a377
$createdAt : 2023-08-28T18:12:18.094+00:00
$updatedAt : 2023-08-28T18:12:18.094+00:00
resourceId : 64ece25fa712e9afa728
resourceType : functions
entrypoint : 'main.dart'
size : 3624
buildId :
activate : true
status :
buildStdout :
buildStderr :
buildTime : 0
✓ Success
status filed
Docker Error: mv: cannot stat "/usr/code/'main.dart'": No such file or directory
Please do this: https://appwrite.io/docs/functions#gettingStarted
I do everything on this dock
Docker Error: mv: cannot stat "/usr/code/'main.dart'": No such file or directory
Did you run this?
appwrite init function
appwrite deploy function
yes
what is this error?
Docker Error: mv: cannot stat "/usr/code/'main.dart'": No such file or directory
What happened when you ran these?
The code wasn't added to the tar correctly
Or maybe the single quotes were a problem
this problem
Please share the output of running these commands
C:\Users\notik\IdeaProjects\starter>appwrite init function
? What would you like to name your function? gooh
? What ID would you like to have for your function? unique()
? What runtime would you like to use? Dart (dart-2.17)
✓ Success
C:\Users\notik\IdeaProjects\starter>appwrite deploy function
? Which functions would you like to deploy?
✓ Success Deployed 0 functions
You didn't deploy any function. Select the gooh function to deploy
thank you very much, I finally understood what and how
everything is very confusing and broken GUI
whoever invented it can write quests and earn a lot of money from it
Are you referring to the functions deployment or is there something else?
yes deployment functions
Thanks for the feedback. All of it is going to change in 1.4 so hopefully it's smoother then
Docker Error: Info: Compiling with sound null safety
server.dart:37:27: Error: Method not found: 'start'.
await user_code.start(request, response);
^^^^^
Error: AOT compilation failed
If you're still having trouble after reading the thread, please create a new post