From 9b7cde262adc88264c4e6cb97654c94fbf2e87ff Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Sun, 16 Nov 2025 04:14:40 -0700 Subject: [PATCH] fix: move Worker config to separate file for Pages compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move wrangler.toml to worker/wrangler.toml to separate Worker and Pages configurations. Cloudflare Pages was trying to read wrangler.toml and failing because it contained Worker-specific configuration (Durable Objects, migrations, etc.) that Pages doesn't support. Changes: - Move wrangler.toml → worker/wrangler.toml - Update deploy scripts to use --config worker/wrangler.toml - Pages deployment now uses Cloudflare dashboard configuration only This resolves the deployment error: "Configuration file cannot contain both 'main' and 'pages_build_output_dir'" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- package.json | 4 ++-- wrangler.toml => worker/wrangler.toml | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) rename wrangler.toml => worker/wrangler.toml (93%) diff --git a/package.json b/package.json index b1f9f3d..09d2807 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,9 @@ "build": "tsc && vite build", "build:worker": "wrangler build --config wrangler.dev.toml", "preview": "vite preview", - "deploy": "tsc && vite build && wrangler deploy", + "deploy": "tsc && vite build && wrangler deploy --config worker/wrangler.toml", "deploy:pages": "tsc && vite build", - "deploy:worker": "wrangler deploy", + "deploy:worker": "wrangler deploy --config worker/wrangler.toml", "deploy:worker:dev": "wrangler deploy --config wrangler.dev.toml", "types": "tsc --noEmit" }, diff --git a/wrangler.toml b/worker/wrangler.toml similarity index 93% rename from wrangler.toml rename to worker/wrangler.toml index 235baff..1655a35 100644 --- a/wrangler.toml +++ b/worker/wrangler.toml @@ -1,7 +1,6 @@ -# Cloudflare Pages configuration -pages_build_output_dir = "dist" - -# Worker configuration (for Pages Functions) +# Worker configuration +# Note: This wrangler.toml is for the Worker backend only. +# Pages deployment is configured separately in the Cloudflare dashboard. main = "worker/worker.ts" compatibility_date = "2024-07-01" name = "jeffemmett-canvas"