[SOLVED] dart & flutter - cloud function execution error from client and server
- 1
- Resolved
- Functions
src/server.dart:115:25: Error: Method not found: 'main'.
user_code.main(context)
^^^^
src/server.dart:125:38: Error: Method not found: 'main'.
output = await user_code.main(context);
^^^^
Error: AOT compilation failed
Generating AOT kernel dill failed!```
Am unable to detect what the error is
Kindly assist if you can
dart - function build error
dart - function deployment error
Your function signiture is wrong with you function
Can I see your code? Did you start from a starter template?
It's trying to run the main function of your Appwrite function, but isn't finding the main function
I used the starter template @VincentGe
final client = Client();
// Uncomment the services you need, delete the ones you don't
// final account = Account(client);
// final avatars = Avatars(client);
// final database = Databases(client);
// final functions = Functions(client);
// final health = Health(client);
// final locale = Locale(client);
// final storage = Storage(client);
// final teams = Teams(client);
// final users = Users(client);
client
.setEndpoint("https://cloud.appwrite.io/v1")
.setProject(projectId)
.setKey("API_KEY")
.setSelfSigned(status: true);
emptier();
setter();
// api from env var
apiToken = (req.variables['DAMMY_GONGOZ_API']);
// decode user request
userRequest = await jsonDecode(req.payload);
// decide which service
superResponse = await whichServiceExec();
{
res.json({
'Status': superResponse,
});
}
}```
๐ where did u get this?
this is very very old
sighs
And the function was created today and autogenerated by appwrite cli
ahhh yes
the CLI
can u do appwrite -v ?
what version is ur cli
maybe we missed something ๐
2.0.2
!
sighs
we're on like
4.1
๐
try updating the CLI
lemme know how that goes
Recommended threads
- Function global variables
when i create a top-level global variable in go or bun how will it behave? is the heap getting renewed on every execution or could i do some kind of temp. cachi...
- Appwrite Auth & Function don't reveal cl...
When I execute a function or sign in with my Flutter app, Appwrite does not show my real IP: instead, it seems that Appwrite shows Fastly CDN IP address.
- Why does this happen?
`AppwriteException: general_argument_invalid, Invalid `secret` param: Value must be a valid string and at least 1 chars and no longer than 256 chars (400)` the...