From 0adaac8dbefbbd1006e08dee4d0549035817a69b Mon Sep 17 00:00:00 2001 From: saltbo Date: Wed, 22 Apr 2026 23:31:06 -0400 Subject: [PATCH] fix(cf-deploy): run wrangler from repo root, not dist/zpan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit wrangler 4.x errors when it finds both a local wrangler.json and a parent .wrangler/deploy/config.json redirect file — "base paths do not match" — which is exactly what happens if you cd into dist/zpan after the @cloudflare/vite-plugin build. The old `cd dist/zpan` workaround predates the vite-plugin generating .wrangler/deploy/config.json on build. Now that the redirect file exists, running wrangler from the repo root is the correct path: wrangler picks up the redirect, uses dist/zpan/wrangler.json, and resolves ../client / index.js / etc. relative to *that* config's location — all paths correct. Empirically: `wrangler deploy --dry-run` from root reports "Read 333 files from the assets directory .../dist/client" and all three bindings (D1 + R2 + ASSETS) are recognized. No 404. Fixes the cloudflare deploy job in bonaysoft/zpan's first run of the new dispatcher. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/deploy-cloudflare.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-cloudflare.yml b/.github/workflows/deploy-cloudflare.yml index e7d5f2d0..f305651d 100644 --- a/.github/workflows/deploy-cloudflare.yml +++ b/.github/workflows/deploy-cloudflare.yml @@ -151,10 +151,11 @@ jobs: env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - # Deploy from the @cloudflare/vite-plugin build output so wrangler uses - # the generated dist/zpan/wrangler.json (correct assets directory, - # prebuilt worker) — matches how Cloudflare Workers Builds deploys. - working-directory: dist/zpan + # Run wrangler from the repo root so it uses the @cloudflare/vite-plugin's + # redirect config (.wrangler/deploy/config.json) which points at the + # built Worker (dist/zpan/wrangler.json). Cd'ing into dist/zpan instead + # causes wrangler 4.x to error on conflicting base paths between the + # two configs. run: npx wrangler deploy - name: Set BETTER_AUTH_SECRET (first deploy only)