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
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Project in AppWrite Cloud doesn't allow ...
I have a collection where the data can't be opened. When I check the functions, there are three instances of a function still running that can't be deleted. The...
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...