From 9e9423f61b231e650fd8441d98429ce380137844 Mon Sep 17 00:00:00 2001 From: Fotis Stamatelopoulos Date: Sat, 6 Jun 2026 01:01:59 -0700 Subject: [PATCH] fix(deploy): deploy Edge Functions via --use-api (no Docker bundler) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `cerefox server deploy` shelled out to `supabase functions deploy`, which uses the local Docker bundler when Docker Desktop is running — bind-mounting the function source dir. When the npm package lives under a path Docker Desktop won't file-share (e.g. /usr/local), the mount is empty and every function fails with "entrypoint path does not exist" (issue #84). Pass --use-api to bundle server-side via the Management API: Docker-independent, works regardless of the npm prefix, and the right path for an end-user deploying to cloud Supabase. Verified: deploys all 9 EFs + doctor confirms them live at v0.10.1. Fixes #84. Co-Authored-By: Claude Opus 4.7 --- CHANGELOG.md | 12 +++++++++++- packages/memory/src/cli/commands/deploy-server.ts | 10 +++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 538dc8a..b4c72c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,17 @@ Versioning: [Semantic Versioning](https://semver.org/spec/v2.0.0.html) — all ` ## [Unreleased] -Open roadmap. +### Fixed + +- **`cerefox server deploy` Edge Functions now deploy via the Supabase Management API + (`--use-api`)** instead of the local Docker bundler. The Docker bundler bind-mounts the + function source dir, which fails (`entrypoint path does not exist`) when the npm package + is installed under a path Docker Desktop won't file-share — notably **`/usr/local`** (the + classic Homebrew/`npm config set prefix /usr/local` location) — *and* Docker Desktop is + running. The API path is Docker-independent, so the deploy works regardless of where npm + placed the package or whether Docker is up. (Thanks @tdebasis — [#84].) + +[#84]: https://github.com/fstamatelopoulos/cerefox/issues/84 --- diff --git a/packages/memory/src/cli/commands/deploy-server.ts b/packages/memory/src/cli/commands/deploy-server.ts index f8d7d12..d22f782 100644 --- a/packages/memory/src/cli/commands/deploy-server.ts +++ b/packages/memory/src/cli/commands/deploy-server.ts @@ -297,7 +297,15 @@ async function action(options: DeployServerOptions): Promise { // (link state lives in whatever dir the user ran `supabase link`), so a // bare deploy here couldn't resolve the target project. const workdir = assets.functionsDir.replace(/\/functions$/, "").replace(/\/supabase$/, ""); - const args = ["--yes", "supabase", "functions", "deploy", ef]; + // `--use-api`: bundle + deploy via the Supabase Management API instead of the local + // Docker bundler. The Docker bundler bind-mounts the function source dir into a + // container; when the npm package is installed under a path Docker Desktop won't share + // (e.g. /usr/local — not on its default file-sharing allowlist), the mount is empty and + // every function fails with "entrypoint path does not exist" (issue #84). The API path + // is Docker-independent (it's the same fallback the CLI uses when Docker is off) and is + // the right path for an end-user deploying to their cloud Supabase — no local Docker + // bundler needed. Requires a reasonably current Supabase CLI (we resolve latest via npx). + const args = ["--yes", "supabase", "functions", "deploy", ef, "--use-api"]; if (projectRef) args.push("--project-ref", projectRef); const r = spawnSync("npx", args, { encoding: "utf8",