Skip to content
Back

I can't share code between functions

  • 0
  • Self Hosted
  • Functions
  • Tools
Anton Androsov
4 Feb, 2026, 19:28

Operating System: MacOS Appwrite Version: self-hosted 1.8.1 Appwrite CLI Version: 13.2.1

I want to split code up to share it between my functions. At the moment i have signup function and common code only.

I have paths:

  • functions/common - my common code
  • functions/signup - my function

I have created a relative soft link of my functions/common in functions/signup/src which i have named common.

I used command: ln -s "../../common" "./common" in the functions/signup/src folder

You can see structure of my project on the image.

It seems work but appwrite cli fails when i run my function using appwrite cli command: appwrite run function

TL;DR
Developer is trying to share code between functions in their Appwrite project by creating a soft link, but encounters a RangeError when running the function using Appwrite CLI. The solution is to add "common" to the .appwriteignore file in the same directory as the Appwrite CLI configuration file. This will prevent the CLI from processing the symlinked code and resolve the issue.
Anton Androsov
4 Feb, 2026, 19:28

Appwrite Cli throws exception:

TypeScript
/opt/homebrew/Cellar/appwrite/13.2.1/libexec/lib/node_modules/appwrite-cli/dist/cli.cjs:80636
      throw new Ctor(message);
            ^

RangeError: path should be a `path.relative()`d string, but got "../common"
    at throwError (/opt/homebrew/Cellar/appwrite/13.2.1/libexec/lib/node_modules/appwrite-cli/dist/cli.cjs:80636:13)
    at checkPath (/opt/homebrew/Cellar/appwrite/13.2.1/libexec/lib/node_modules/appwrite-cli/dist/cli.cjs:80650:16)
    at Ignore._test (/opt/homebrew/Cellar/appwrite/13.2.1/libexec/lib/node_modules/appwrite-cli/dist/cli.cjs:80688:9)
    at Ignore.ignores (/opt/homebrew/Cellar/appwrite/13.2.1/libexec/lib/node_modules/appwrite-cli/dist/cli.cjs:80734:21)
    at ignored (/opt/homebrew/Cellar/appwrite/13.2.1/libexec/lib/node_modules/appwrite-cli/dist/cli.cjs:140376:24)
    at matchPatterns (/opt/homebrew/Cellar/appwrite/13.2.1/libexec/lib/node_modules/appwrite-cli/dist/cli.cjs:84084:22)
    at FSWatcher._userIgnored (/opt/homebrew/Cellar/appwrite/13.2.1/libexec/lib/node_modules/appwrite-cli/dist/cli.cjs:84102:18)
    at FSWatcher._isIgnored (/opt/homebrew/Cellar/appwrite/13.2.1/libexec/lib/node_modules/appwrite-cli/dist/cli.cjs:87211:21)
    at FsEventsHandler._handleFsEventsSymlink (/opt/homebrew/Cellar/appwrite/13.2.1/libexec/lib/node_modules/appwrite-cli/dist/cli.cjs:86490:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
Emitted 'error' event on FSWatcher instance at:
    at FSWatcher._handleError (/opt/homebrew/Cellar/appwrite/13.2.1/libexec/lib/node_modules/appwrite-cli/dist/cli.cjs:87100:16)
    at FsEventsHandler._handleFsEventsSymlink (/opt/homebrew/Cellar/appwrite/13.2.1/libexec/lib/node_modules/appwrite-cli/dist/cli.cjs:86504:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)

Node.js v25.5.0
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