Back

Function deployment failed - Failed to create shim...

  • 0
  • Functions
outrelouxhe
10 Mar, 2023, 03:22
TL;DR
The user experienced a "Function deployment failed" error. They discovered that the issue was caused by using the variable name "PATH" in their code. Renaming the variable resolved the issue.
outrelouxhe
10 Mar, 2023, 03:24

I made it a third time and it works as well.

outrelouxhe
10 Mar, 2023, 03:24

Now I will add the dependencies without changing the code...

outrelouxhe
10 Mar, 2023, 03:30

adding the dependencies does not generate the issue...

outrelouxhe
10 Mar, 2023, 03:33

so it means that I really need to add almost line by line my code in this function and check at what time it fails !

outrelouxhe
10 Mar, 2023, 03:34

Thank you for having guided me back to the basics and put me back at a point where I can start again

outrelouxhe
10 Mar, 2023, 03:35

I'll keep you posted with the result of this.

outrelouxhe
10 Mar, 2023, 04:06

OK I have found the issue. It appears when a variable "PATH" is present : { "$id": "test4", "name": "test4", "runtime": "dart-2.17", "path": "functions/test4", "entrypoint": "lib/main.dart", "ignore": [ ".packages", ".dart_tool" ], "execute": [], "events": [], "schedule": "", "timeout": 15, "variables": { "PATH": "path" } }

Drake
10 Mar, 2023, 04:06

Oh wow lol

outrelouxhe
10 Mar, 2023, 04:07

I just have to rename the variable and then it works...

outrelouxhe
10 Mar, 2023, 04:07

But it looks like either a bug either a documentation issue where PATH should be a reserved word

outrelouxhe
10 Mar, 2023, 04:08

Anyway thanks again for your support.

Drake
10 Mar, 2023, 04:09

Cc @VincentGe πŸ˜‚

VincentGe
10 Mar, 2023, 15:36

🀣

VincentGe
10 Mar, 2023, 15:37

Which page is this on?

Drake
10 Mar, 2023, 17:23

we might want to document in our functions docs or maybe on the variables page in the console.

Drake
10 Mar, 2023, 17:23

maybe...

VincentGe
10 Mar, 2023, 17:25

:πŸ‘€

VincentGe
10 Mar, 2023, 17:27

I vote for adding reserved keywords as a check in console @Sara @Chen. If it can't be set, we should just prevent it via code.

I also think we can add checks for the route with better error messages.

This is too much fine detail to expect people to read πŸ˜“

VincentGe
10 Mar, 2023, 17:27

When we can just tell them they can't when they try it's easier

Drake
10 Mar, 2023, 17:43

that's a good idea

Chen
12 Mar, 2023, 08:29

cc @Carla

Drake
12 Mar, 2023, 16:12

Actually, maybe not console. Maybe the API should block certain variable names

Carla
13 Mar, 2023, 00:16

Agree -- we could also include a recommendation in the UI about suggested variable names or ones that shouldn't be used if it will help reduce user error

VincentGe
13 Mar, 2023, 14:03

πŸ‘€ Yeah ideally we just help them out with a more specific hint, or just like don't let them enter the first letter as a symbol or smthing else. Feels totally preventable via code

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