Skip to content
Back

[SOLVED] Write cloud function in dart

  • 0
  • Self Hosted
  • Flutter
  • Functions
Ipsoka
27 Mar, 2023, 18:55

Where exactly do I add dart in my .env file?

TL;DR
Summary: User is encountering an error cloning a repository when trying to write a cloud function in Dart using Appwrite. The error appears to be due to insufficient RAM on the user's device. It is suggested to enable swap or upgrade to a device with at least 2GB of RAM. Clearing unused Docker images using "docker system prune" is recommended. The user can also safely remove unused function runtimes. It is clarified that the Dart version on the user's machine does not matter as each function runs in a separate container. The specified Dart version is pulled from Docker, not the local Dart SDK. To add Dart in the .
rafagazani
27 Mar, 2023, 18:55
Ipsoka
27 Mar, 2023, 18:55

ahh okay

rafagazani
27 Mar, 2023, 18:56

after adding you need to restart your docker

Ipsoka
27 Mar, 2023, 18:56

And the dart I chose is the dart that is installed on the system where i self hosted appwrite correct?

Ipsoka
27 Mar, 2023, 18:56

the dart version*

Binyamin
27 Mar, 2023, 18:56

Yes

rafagazani
27 Mar, 2023, 18:58

each function runs in a separate container, your vps dart does not influence your functions

Ipsoka
27 Mar, 2023, 19:00

so when I specify dart-2.19.4, is it pulled form docker or is it the local dart sdk that is installed on the system

Drake
27 Mar, 2023, 19:01

The dart version on your machine doesn't matter. we have dart docker images for various versions of dart. You must use 1 of the supported runtimes as described in the docs: https://appwrite.io/docs/functions#supportedRuntimes

rafagazani
27 Mar, 2023, 19:02

it will "download" the correct sdk. No need to worry about it. Just put it in your .env file and everything should work.<:appwriteheart2:1073243188954935387>

Ipsoka
27 Mar, 2023, 19:02

Now it clicked, cool thanks 😄

Ipsoka
27 Mar, 2023, 19:05

Btw, Can I safly remove function runtimes that im not going to use such as ruby or php?

rafagazani
27 Mar, 2023, 19:08

yes

Ipsoka
27 Mar, 2023, 19:08

Will it remove them aswell so that I can save space on my tiny tiny raspberry pi?

rafagazani
27 Mar, 2023, 19:10

https://jimbobbennett.dev/blogs/install-appwrite-rpi/ <:appwritepeepo:902865250427215882>

Drake
27 Mar, 2023, 19:10

probably best to do docker system prune to clear out unused images

Ipsoka
27 Mar, 2023, 19:11

I saw that aswell, but I think the raspberry pi I own (pi 3 b+) is not fast enough for appwrite 😦 It only has 1gb ram I think

rafagazani
27 Mar, 2023, 19:13

you need at least 2gb ram

Ipsoka
27 Mar, 2023, 19:21

When doing appwrite init function im getting the following:

✗ Error Command failed: git clone --depth 1 --sparse https://github.com/appwrite/functions-starter . Cloning into '.'... fatal: cannot change to 'https://github.com/appwrite/functions-starter': No such file or directory error: failed to initialize sparse-checkout

any ideas why this is happening?

Input:

? What would you like to name your function? Is Already Registered ? What ID would you like to have for your function? unique() ? What runtime would you like to use? Dart (dart-2.17)

Drake
27 Mar, 2023, 19:27

It might be able to run....just very slow, if you enable swap.

Drake
27 Mar, 2023, 19:27

Best to create separate distinct posts

Ipsoka
27 Mar, 2023, 19:45

[SOLVED] Write cloud function in dart

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more