StefanBOriginal post
Rank 2: Process
I try to create a cloud function, where I have following folder structure:
.
|-lib/
-main.dart
|-.appwrite/
|-pubspec.yaml
|-pubspec.lock
After manuel deployment via the appwrite console (cloud) I get this error:
Error: Couldn't resolve the package 'dart_appwrite' in 'package:dart_appwrite/dart_appwrite.dart'.
server.dart:37:27: Error: Method not found: 'start'.
await user_code.start(request, response);
Where does user_code come from?
Any other things I made wrong?
Summary
To solve the issue, make sure you have the 'dart_appwrite' package imported correctly in your `pubspec.yaml` file. Check your dependencies and ensure the package is included. Additionally, check that you have the correct version of the package specified.
The error you're seeing is caused by a missing method 'start' in your code. 'user_code' is a reference to the Cloud Functions runtime code and is merged with your code during deployment. Ensure that your function code has a 'start' method defined.
It is recommended to initialize your function code using the Appwrite CLI as it provides a good foundation.