From 4894f1e439db6afab483cac4d47f1e35d56317e7 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Mon, 10 Nov 2025 11:51:57 -0800 Subject: [PATCH] latest update to fix cloudflare --- CLOUDFLARE_PAGES_SETUP.md | 37 +++++++++++++++++++ FATHOM_INTEGRATION.md | 1 + WORKER_ENV_GUIDE.md | 1 + src/components/location/LocationDashboard.tsx | 1 + src/components/location/LocationMap.tsx | 1 + src/components/location/LocationViewer.tsx | 1 + src/components/location/ShareSettings.tsx | 1 + src/css/location.css | 1 + src/lib/location/types.ts | 1 + src/routes/LocationDashboardRoute.tsx | 1 + src/routes/LocationShareCreate.tsx | 1 + src/routes/LocationShareView.tsx | 1 + switch-worker-env.sh | 1 + wrangler.toml | 3 -- 14 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 CLOUDFLARE_PAGES_SETUP.md diff --git a/CLOUDFLARE_PAGES_SETUP.md b/CLOUDFLARE_PAGES_SETUP.md new file mode 100644 index 0000000..27667c1 --- /dev/null +++ b/CLOUDFLARE_PAGES_SETUP.md @@ -0,0 +1,37 @@ +# Cloudflare Pages Configuration + +## Issue +Cloudflare Pages cannot use the same `wrangler.toml` file as Workers because: +- `wrangler.toml` contains Worker-specific configuration (main, account_id, triggers, etc.) +- Pages projects have different configuration requirements +- Pages cannot have both `main` and `pages_build_output_dir` in the same file + +## Solution: Configure in Cloudflare Dashboard + +Since `wrangler.toml` is for Workers only, configure Pages settings in the Cloudflare Dashboard: + +### Steps: +1. Go to [Cloudflare Dashboard](https://dash.cloudflare.com/) +2. Navigate to **Pages** → Your Project +3. Go to **Settings** → **Builds & deployments** +4. Configure: + - **Build command**: `npm run build` + - **Build output directory**: `dist` + - **Root directory**: `/` (or leave empty) +5. Save settings + +### Alternative: Use Environment Variables +If you need to configure Pages via code, you can set environment variables in the Cloudflare Pages dashboard under **Settings** → **Environment variables**. + +## Worker Deployment +Workers are deployed separately using: +```bash +npm run deploy:worker +``` +or +```bash +wrangler deploy +``` + +The `wrangler.toml` file is used only for Worker deployments, not Pages. + diff --git a/FATHOM_INTEGRATION.md b/FATHOM_INTEGRATION.md index fd8e9b4..718afe6 100644 --- a/FATHOM_INTEGRATION.md +++ b/FATHOM_INTEGRATION.md @@ -134,5 +134,6 @@ The Fathom transcript shape includes: + diff --git a/WORKER_ENV_GUIDE.md b/WORKER_ENV_GUIDE.md index e2a36ad..33bfe23 100644 --- a/WORKER_ENV_GUIDE.md +++ b/WORKER_ENV_GUIDE.md @@ -85,5 +85,6 @@ You can also manually edit the environment by: + diff --git a/src/components/location/LocationDashboard.tsx b/src/components/location/LocationDashboard.tsx index 52ffa40..9135784 100644 --- a/src/components/location/LocationDashboard.tsx +++ b/src/components/location/LocationDashboard.tsx @@ -262,5 +262,6 @@ export const LocationDashboard: React.FC = () => { + diff --git a/src/components/location/LocationMap.tsx b/src/components/location/LocationMap.tsx index b4d181f..797ef20 100644 --- a/src/components/location/LocationMap.tsx +++ b/src/components/location/LocationMap.tsx @@ -233,5 +233,6 @@ export const LocationMap: React.FC = ({ + diff --git a/src/components/location/LocationViewer.tsx b/src/components/location/LocationViewer.tsx index 6e21f82..999eaab 100644 --- a/src/components/location/LocationViewer.tsx +++ b/src/components/location/LocationViewer.tsx @@ -175,5 +175,6 @@ export const LocationViewer: React.FC = ({ shareToken }) => + diff --git a/src/components/location/ShareSettings.tsx b/src/components/location/ShareSettings.tsx index bd50863..5c1f6f6 100644 --- a/src/components/location/ShareSettings.tsx +++ b/src/components/location/ShareSettings.tsx @@ -142,5 +142,6 @@ export const ShareSettingsComponent: React.FC = ({ onSetting + diff --git a/src/css/location.css b/src/css/location.css index 748e757..e5c4981 100644 --- a/src/css/location.css +++ b/src/css/location.css @@ -417,5 +417,6 @@ + diff --git a/src/lib/location/types.ts b/src/lib/location/types.ts index afebced..5aed206 100644 --- a/src/lib/location/types.ts +++ b/src/lib/location/types.ts @@ -47,5 +47,6 @@ export interface GeolocationPosition { + diff --git a/src/routes/LocationDashboardRoute.tsx b/src/routes/LocationDashboardRoute.tsx index c242039..7d5a78f 100644 --- a/src/routes/LocationDashboardRoute.tsx +++ b/src/routes/LocationDashboardRoute.tsx @@ -29,5 +29,6 @@ export const LocationDashboardRoute: React.FC = () => { + diff --git a/src/routes/LocationShareCreate.tsx b/src/routes/LocationShareCreate.tsx index eea6129..dd11ea6 100644 --- a/src/routes/LocationShareCreate.tsx +++ b/src/routes/LocationShareCreate.tsx @@ -29,5 +29,6 @@ export const LocationShareCreate: React.FC = () => { + diff --git a/src/routes/LocationShareView.tsx b/src/routes/LocationShareView.tsx index acbe700..42266f5 100644 --- a/src/routes/LocationShareView.tsx +++ b/src/routes/LocationShareView.tsx @@ -43,5 +43,6 @@ export const LocationShareView: React.FC = () => { + diff --git a/switch-worker-env.sh b/switch-worker-env.sh index c31da61..d0606a8 100644 --- a/switch-worker-env.sh +++ b/switch-worker-env.sh @@ -64,5 +64,6 @@ echo " npm run dev" + diff --git a/wrangler.toml b/wrangler.toml index 5ff78de..7a1b61e 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -3,9 +3,6 @@ compatibility_date = "2024-07-01" name = "jeffemmett-canvas" account_id = "0e7b3338d5278ed1b148e6456b940913" -# Cloudflare Pages configuration -pages_build_output_dir = "dist" - [vars] # Environment variables are managed in Cloudflare Dashboard # Workers & Pages → jeffemmett-canvas → Settings → Variables