I am getting a cannot find module error when executing a function on the console. I am at the root of the project folder - with following structure.
- appwrite.json
- functions/functionName/src/index.js
Running command from terminal as below -
“appwrite functions createDeployment \
--functionId=idReplaced \
--activate=true \
--entrypoint="funtionName/src/index.js" \
--code="." “
Error as below :
Error: Cannot find module '/usr/code-start/functionName/src/index.js'
Require stack:
“ - /usr/local/src/server.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:940:15) “
What is the correct "entrypoint" value in the command to point to the code
I got it working now. Since, I had only one function, the function name looked selected in the command line & I could not figure out that it was not. I had to select it using the "space" key. Once this is done, the function started working fine.
Recommended threads
- Python function - error while creating /...
I have been trying to figure it out myself for the last 2 days. I have self-hosted appwrite instance, and I am running python 3.12 function. It works great up t...
- Functions not executing after usage rese...
Hi team, Last month my project hit 100% usage and functions stopped working (expected). Now the new month has started and usage has reset, requests are going ...
- Functions never end and always fail (sta...
Hi ! I'm using Appwrite Cloud Pro and function execution from appwrite website is KO. Deploying starter function template, execution is always Failed and the ...