Skip to content

fix: get the Cloudflare Worker deploy actually working - #33

Merged
vedantlavale merged 1 commit into
mainfrom
feat/coming-soon
Sep 27, 2026
Merged

vedantlavale merged 1 commit into
mainfrom
feat/coming-soon

Conversation

@vedantlavale

Copy link
Copy Markdown
Owner

Two follow-up fixes after merging #31, found from the real Cloudflare build logs.

  1. 056acdb — main had no Cloudflare config at all (no wrangler.jsonc, and next.config.ts wasn't set to static export, plus it still had redirects()/rewrites(), which Next.js refuses to build alongside output: "export"). Added output: "export", wrangler.jsonc, and moved the retired-route redirects + security headers to public/_redirects / public/_headers (Cloudflare's own static-Worker convention).

  2. c37de05 — the first deploy attempt got much further (build succeeded, assets uploaded) but Cloudflare rejected the _redirects file: "Proxy (200) redirects can only point to relative paths." The PostHog ingestion proxy (/api/metrics/* → us.i.posthog.com) doesn't work on a static-assets Worker at all — no server exists to proxy through. Dropped those 3 lines; instrumentation-client.ts already reads NEXT_PUBLIC_POSTHOG_HOST directly and falls back to the real ingestion host, so analytics still work, just not proxied through our own domain anymore.

Verified locally both times: bun run build produces a clean out/ with valid _redirects/_headers.

🤖 Generated with Claude Code

Copilot AI lite review requested due to automatic review settings September 27, 2026 14:23
@vercel

vercel Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
billy Ready Ready Preview Sep 27, 2026 2:26pm UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Failed ❌

View logs ↗
e59324c 2026-09-27T14:26:41.689Z View logs ↗
  • Build: Failed ❌

View logs ↗
c37de05 2026-09-27T14:20:46.376Z View logs ↗

Cloudflare rejected the deploy: "Proxy (200) redirects can only point
to relative paths." A static-assets Worker has no server, so it can't
reverse-proxy /api/metrics/* to a different domain the way Next's
rewrites() (or a real server) could -- that needs an actual Worker
script, which this project deliberately doesn't have.

PostHog still works: instrumentation-client.ts already reads
NEXT_PUBLIC_POSTHOG_HOST directly and falls back to the real ingestion
host now, so analytics aren't blocked, they're just no longer routed
through our own domain to dodge ad blockers.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vedantlavale
vedantlavale merged commit 95f993b into main Sep 27, 2026
2 of 4 checks passed

This branch was successfully deployed

1 active deployment
Preview — e59324c6 Deployed Sep 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants