Back

1.4.2 function syntax problem

  • 0
  • Self Hosted
  • Functions
Drake
17 Oct, 2023, 23:53

What exactly did you do with the CLI?

TL;DR
User is experiencing a syntax problem with a function in version 1.4.2. They may have accidentally changed the version of dart_appwrite from 8.0.0 to 10.0.0. They are unable to find the `appwrite init function` and are inquiring about the currency exchange sample. Support suggests deleting the function from appwrite, the local file system, and appwrite.json, then initializing and deploying the dart starter to test in Appwrite. There's a conversation about upgrading to different versions of appwrite and running the upgrade and migrate commands. User successfully deploys the 2.18 function
mandolfo
18 Oct, 2023, 00:04

upgraded the CLI globally (today).

Created the function locally with the CLi. This was added to appwrite.json

TypeScript
{
            "$id": "purge",
            "name": "purge",
            "runtime": "dart-2.18",
            "execute": [],
            "events": [],
            "schedule": "",
            "timeout": 55,
            "enabled": true,
            "logging": true,
            "entrypoint": "lib/main.dart",
            "commands": "dart pub get",
            "ignore": [
                ".packages",
                ".dart_tool"
            ],
            "path": "functions/purge"
        }

dart 2.18 is set in .env It gets built. But it throws. Bad definition IMO.

Drake
18 Oct, 2023, 00:05

and you never had a function w/ id purge?

mandolfo
18 Oct, 2023, 00:05

never

mandolfo
18 Oct, 2023, 00:07

I am using this as a woraround.

TypeScript
 List<String> log = [];

  log.add("Profile image pruning initiated...");

But I still can't .send anything back.

Drake
18 Oct, 2023, 00:12

you're executing the code in appwrite, right?

Drake
18 Oct, 2023, 00:14

what are you talking about?

mandolfo
18 Oct, 2023, 00:16

Yes. From the console.

Drake
18 Oct, 2023, 00:16

i just tried deploying the 2.18 function starter and it worked fine

mandolfo
18 Oct, 2023, 00:17

created using the CLI?

Drake
18 Oct, 2023, 00:17

yes

Drake
18 Oct, 2023, 00:17

did you upgrade to appwrite 1.4.2?

mandolfo
18 Oct, 2023, 00:18

yes. from 141<140<133

mandolfo
18 Oct, 2023, 00:18

Migration were ok

Drake
18 Oct, 2023, 00:19

did you run the upgrade command?. btw...you probably should have upgraded to 1.3.8 and ran the migrate command before upgrading to 1.4...

mandolfo
18 Oct, 2023, 00:20

you mean like entrypoint="upgrade"? yes

Drake
18 Oct, 2023, 00:21

what other changes did you make to the function starter before deploying?

mandolfo
18 Oct, 2023, 00:21

I think I deployed it as 2.17 then 2.18

Drake
18 Oct, 2023, 00:23

try deleting the function from appwrite, your local file system, and the appwrite.json. then, initialize and deploy the dart starter and test that in Appwrite

mandolfo
18 Oct, 2023, 00:26

The currecy exchange sample ?

Drake
18 Oct, 2023, 00:27

no appwrite init function

mandolfo
18 Oct, 2023, 00:33

the starter runs fine.

I may have changed dart_appwrite: 8.0.0 to dart_appwrite: ^10.0.0

Drake
18 Oct, 2023, 00:34

then some change you made caused problems...work incrementally to narrow down what the problem is

mandolfo
18 Oct, 2023, 00:35

Thanks. Can't live w/o proper logs.

mandolfo
18 Oct, 2023, 00:36

I haven't had much time since 1.3.3 to keep up with changes

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