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 Can I Create landing page in appwrit...
I created function called invoice URL https://app.getrestt.com/v1/functions/invoice/executions?id=test-76f948fe83c43422561fe096c0674a1bd3ff0702cdfcf2444293ab31...
- DeploymentStatus enum value `canceled` m...
Hey, Sorry if it has been reported already, I found an issue using the Dart SDK where the `canceled` enum value is missing from `DeploymentStatus`. This causes...
- Synchronous function execution timeout w...
I am calling server functions with xasync = true and I still get this error message. Synchronous function execution timed out. Use asynchronous execution inste...