Back

[SOLVED] Method not found: 'main'.

  • 0
  • Functions
Bendix Behn
12 Sep, 2023, 13:52

With v.1.4.2 the building of dart functions doesnt work anymore. I always get the following error message in the logs:

TypeScript
Info: Compiling with sound null safety.
src/server.dart:115:25: Error: Method not found: 'main'.
              user_code.main(context)
                        ^^^^
src/server.dart:125:38: Error: Method not found: 'main'.
            output = await user_code.main(context);
                                     ^^^^
Error: AOT compilation failed
Generating AOT kernel dill failed!
TL;DR
User encountered an error "Method not found: 'main'" when trying to build dart functions with version 1.4.2. The suggested solution is to upgrade to the latest version (4.0.0) of appwrite-cli by running "npm install -g appwrite-cli" and try again.
Binyamin
12 Sep, 2023, 13:54

How you've created the function?

Bendix Behn
12 Sep, 2023, 14:28

with the cli command: appwrite init function

Binyamin
12 Sep, 2023, 14:29

What this shows

TypeScript
appwrite --version
Bendix Behn
12 Sep, 2023, 14:30

1.1.1

Binyamin
12 Sep, 2023, 14:31

Can you upgrade to the last one 4.0.0, for example in NPM

TypeScript
npm install -g appwrite-cli

And try again As that cli required for version 1.4.+

Bendix Behn
12 Sep, 2023, 14:31

I´ll try. Thank you!

Bendix Behn
12 Sep, 2023, 14:52

works! 🙏

Binyamin
12 Sep, 2023, 14:52

<:appwritefire:823999000330895380> Great

hamed
12 Sep, 2023, 14:59

Wich dart version?

Bendix Behn
12 Sep, 2023, 15:00

3.0

Drake
12 Sep, 2023, 17:26

[SOLVED] Method not found: 'main'.

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