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
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Project in AppWrite Cloud doesn't allow ...
I have a collection where the data can't be opened. When I check the functions, there are three instances of a function still running that can't be deleted. The...
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...