armanhadiOriginal post
Rank 2: Process
I just deployed appwrite function to my selfhost appwrite connected github also build the function succesfully but I get this error when I try to execute the function for get request inside the appwrite dashboard
`Could not load code file.
Error: Cannot find module '/usr/local/server/src/function/main.js'
Require stack:
- /usr/local/server/src/server.js
at Module._resolveFilename (node:internal/modules/cjs/loader:939:15)
at Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:81:25)
at require (node:internal/modules/cjs/helpers:102:18)
at execute (/usr/local/server/src/server.js:123:28)
at /usr/local/server/src/server.js:158:33
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)`
Summary
The user is experiencing an error when trying to execute an Appwrite function. The error message states that the module '/usr/local/server/src/function/main.js' cannot be found. The user created the function locally and pushed it to their repository without making any changes to the generated code. The function was successfully built, but the error occurs when trying to execute a GET request in the Appwrite dashboard.
Solution: The error suggests that the main.js module cannot be found. Make sure the file path is correct and that the module is in the specified location. Double-check the repository and build settings to ensure everything is set up correctly. If the file