I have written a function (DART) and it won't deploy. Here is what I get : 2026-03-14T17:09:41.459693680Z Compiling ... 2026-03-14T17:09:42.915619217Z ../build/lib/main.dart:14:3: Error: 'TablesDB' isn't a type. 2026-03-14T17:09:42.915658150Z TablesDB tablesDB = TablesDB(client); 2026-03-14T17:09:42.915662412Z ^^^^^^^^ 2026-03-14T17:09:42.915666286Z ../build/lib/main.dart:14:23: Error: Method not found: 'TablesDB'. 2026-03-14T17:09:42.915669114Z TablesDB tablesDB = TablesDB(client); 2026-03-14T17:09:42.915673757Z ^^^^^^^^ 2026-03-14T17:09:42.915712899Z Error: AOT compilation failed 2026-03-14T17:09:42.915717369Z Bad state: Generating AOT kernel dill failed!
Anyone has an idea why it won't work ?
It might be happening because you're probably using the older sdk for dart in which TablesDB wasn't available. Try using newer version of the sdk or switch to old Database.
How do I use the new SDK for Dart ? Pb with old Database is that there are plenty of functions which didn't exist, like deleteRows....
Are you using version 19.0.0 ?
In the function ? How do I know that ?
I mean check your sdk version
And tell me
Am sorry... all I see in the Appwrite dunction settings is : RunTime Dart-3.10
Ok ok.. are you able to find pubspec.yaml file in your function's folder?
I have this : name: starter_template version: 1.0.0
environment: sdk: ^2.17.0
dependencies: dart_appwrite: 8.0.0
dev_dependencies: lints: ^2.0.0
But I guess this was created automatically from the appwrite cloud onto my github
Look! The issue is exactly what I thought. Based on this file, you're using an older sdk version (i.e. 8.0.0) here. Upgrade to version 13.0.0 or above for using TablesDB features.
You can manually edit the version in your file for updating if you don't prefer using CLI
That's what I am doing. I changed it in github. What's the latest version I can use ?
Apparently, it's still not working. I believe APPWRITE CLOUD FUNCTION do not support thie version of dart SDK yet
Ok then you can create an issue for this in the github repo and inform about the same in the https://discord.com/channels/564160730845151244/636852860709240842 channel
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...