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
- Confusion around Tables / TablesDB vs Da...
Hello everyone, I ran into quite a bit of confusion when trying to migrate a Function from Databases.createDocument() to the new Tables / Rows API and wanted t...
- No permissions provided for action 'read...
I have a very weird error; In a function I'm using dynamic keys to perform read write operation in rows. I have the scopes for read and write rows. The funct...
- Repository directory size should be less...
Whenever I create a function i get the error above. Is there a way to get around this? How do I fix this?