Global variables set in a project are not available to functions executions. Global variables are available during build phase tho
Same issue!
how are y'all executing the function?
Through dart sdk (create execution), I will try to do a execute from console if this will have global variables
i can confirm the problem and crated an issue: https://github.com/appwrite/appwrite/issues/6113
Cool For everybody who needs it - Workaround for now is to use local function variables.
I updated the Appwrite to 1.4.2 and redeployed the function. But still, Project-level global envs are not available in the functions.
have you ran migration?
Yes
cd appwrite/
docker compose exec appwrite migrate
so i just tested this and it seemed to work...project level variable is in the environment and variables with a conflict properly get overridden
Attaching the screenshots, just to confirm the implementation from my end. Can you please verify?
Runtime: node-18.0
looking at the project variables in the console, would you please open the editor, switch to the JSON view and share that?
also, how are you executing the function?
I deployed manually and executing using the Appwrite console
so i tested again with node 18 and everything seems to be working fine on my end 🧐
Interesting! I just created a new project and copied the same function with Global Variable. It worked! It seems like the migrated Projects are not getting the Global variable or maybe my instance is messed up somehow
back in your old project, have you tried deleting the variable and recreating it?
Yes, I did
Recommended threads
- router_deployment_not_found
I updated my function a few times and now i am getting the error: router_deployment_not_found I even reverted back to my original code but i am still getting th...
- Usage of the new Client() and dealing wi...
Hey guys, just a quick one - we had some web traffic the other day and it ended up bombing out - To put in perspective of how the app works, we have a Nuxt Ap...
- [Beginner] CLI --queries Syntax Error & ...
Hi everyone! I am a beginner with Appwrite and trying to use the CLI, but I'm stuck with a syntax error. Any guidance would be greatly appreciated! 🙏 **Enviro...