Skip to content
Back

Cannot find module failure

  • 0
  • Functions
Jerrold
2 Jul, 2025, 23:41

Sorry, Newbe question here. I just installed Appwrite and am trying to install my first Function an am having absolutely no luck what-so-ever getting this done.

I've been using the "+ Create Function" button and choosing the Create manually option.

Name: Hello Runtime: Node.js - 16.0 Upload: test-function.tar.gz which includes /packet.json and /src/index.js Endpoint: src/index.js Build commands: None Execution Permission: Any

The function builds successully and reports "Active".

I then test with "Execute now".

Path: / Method: Post Header Name: None Header Value: None Body: None

I then get this error message:

Could not load code file. Error: Cannot find module '/usr/local/server/src/function//src/index.js' Require stack:

  • /usr/local/server/src/server.js at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Module.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:139:28) at action (/usr/local/server/src/server.js:174:33) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async /usr/local/server/src/server.js:10:9

What am I doing wrong?

TL;DR
Developers are experiencing module errors when trying to execute a newly created function in Appwrite. The issue stems from the incorrect path specified for the module. The correct path should be `/usr/local/server/src/function/src/index.js` instead of `/usr/local/server/src/function//src/index.js`. Update the path accordingly to resolve the error.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more