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
- Function domain not available
Hello, even tho in docs you clearly describe that every function has its domain, I can not see it anywhere in any of my projects. How do I reveal the url of th...
- Inquiry: How to Reduce Cold Start Durati...
Hey! I was using Python for the function runtime, but after reading that Go has the fastest runtime, I switched my code over to Go. However, I'm still seeing co...
- After a GET request is passed to functio...
Create execution in the console can normally retrieve the get parameters。WHy?