From fa006906f15c501520e82f4394aa8a22fcd4e3e0 Mon Sep 17 00:00:00 2001 From: Elie Habib Date: Tue, 17 Mar 2026 13:42:18 +0400 Subject: [PATCH] fix(relay): add root nixpacks.toml to install scripts/ deps on Railway (#1760) Railway builds from repo root (root_dir=""), so scripts/nixpacks.toml is skipped. Root packages are installed via npm ci but scripts/package.json deps (@anthropic-ai/sdk, fast-xml-parser, etc.) never land in /app/node_modules, causing ERR_MODULE_NOT_FOUND at runtime. Add a root nixpacks.toml that: - Preserves existing scripts/nixpacks.toml settings (curl, NODE_OPTIONS) - Adds `npm install --prefix scripts` to the build phase so all scripts/package.json deps are installed alongside root deps --- nixpacks.toml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 nixpacks.toml diff --git a/nixpacks.toml b/nixpacks.toml new file mode 100644 index 000000000..b9a74c58e --- /dev/null +++ b/nixpacks.toml @@ -0,0 +1,17 @@ +# Railway relay build config (root_dir="" — builds from repo root). +# Promotes scripts/nixpacks.toml settings here since nixpacks only reads +# config from the build root. Adds scripts/ dep install so that packages +# in scripts/package.json (e.g. @anthropic-ai/sdk, fast-xml-parser) are +# available at runtime when node scripts/ais-relay.cjs is started. + +[phases.setup] +aptPkgs = ["curl"] + +[variables] +NODE_OPTIONS = "--dns-result-order=ipv4first" + +[phases.install] +cmds = ["npm ci"] + +[phases.build] +cmds = ["npm install", "npm install --prefix scripts"]