
Tried deploying a sample serverless function using the dart
runtime and i get this error
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
Generating AOT kernel dill failed!

Sample function code below:
import 'dart:async';
import 'package:dart_appwrite/dart_appwrite.dart';
// This is your Appwrite function
// It's executed each time we get a request
Future<dynamic> main(final context) async {
// Why not try the Appwrite SDK?
//
// final client = Client()
// .setEndpoint('https://cloud.appwrite.io/v1')
// .setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)
// .setKey(process.env.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 `req` object contains the request data
if (context.req.method == 'GET') {
// Send a response with the res object helpers
// `res.send()` dispatches a string back to the client
return context.res.send('Hello, World!');
}
// `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',
});
}

https://appwrite.io/docs/functions-deploy
Here is a document on different ways to deploy a function. Can you specify how are u trying to deploy?

Oh my bad....
I have tried deploying using the Appwrite CLI and Manually by uploading a gzip file but got the same error for both method

This is for Appwrite v1.4. Cloud is on 1.1.2 for now. I suggest installing v2.0.2 of the Appwrite CLI and appwrite init function
to create functions and appwrite deploy function
to deploy

Oh okay
Thanks @Steven
Recommended threads
- 400Invalid query: Attribute not found in...
Hello When I open the database I am not able to reach anything just seeing an error message. Can you help me please?
- Asymetric Authentication for Appwrite si...
Is there any way to do asymmetric authentication of Appwrite users on the server side without making a network call? This can result in a huge reduction in late...
- Registering new flutter app
Hi, ive got an already build flutter app which works in development with appwrite. but with the built version i get an error that the client is not registered. ...
