Skip to content

fix(ci): keep Cloudflare preview URLs enabled across deploys#235

Open
dcrawbuck wants to merge 1 commit into
mainfrom
dcrawbuck/enable-preview-urls
Open

fix(ci): keep Cloudflare preview URLs enabled across deploys#235
dcrawbuck wants to merge 1 commit into
mainfrom
dcrawbuck/enable-preview-urls

Conversation

@dcrawbuck

@dcrawbuck dcrawbuck commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Problem

Cloudflare Preview URLs for branch/PR builds keep silently turning off — you re-enable the toggle in the dashboard, then the next branch build disables it again.

Root cause (confirmed via Cloudflare docs)

Wrangler ≥ 4.44 defaults per-version Preview URLs to match the workers_dev setting when preview_urls isn't set explicitly. This worker has "workers_dev": false, and every deploy (each branch build runs wrangler versions upload) reapplies the config → Preview URLs reset to disabled. With many branch builds, the dashboard toggle gets undone constantly.

Fix

Set "preview_urls": true in wrangler.jsonc so previews persist across deploys. This enables preview URLs only — the production workers.dev route stays false.

Unblocks clicking the per-version / branch preview URLs (e.g. for verifying PR builds like the sitemap work in #222).


Note

Low Risk
Single deploy-config flag with no application code changes; only affects Cloudflare preview URL behavior, not production routing.

Overview
Sets preview_urls: true in wrangler.jsonc so branch/PR deploys stop turning off Cloudflare per-version Preview URLs on every wrangler upload.

With Wrangler ≥ 4.44, missing preview_urls defaults it to match workers_dev (false here), which overwrote manual dashboard toggles. workers_dev stays false for production; only preview URLs are explicitly enabled.

Reviewed by Cursor Bugbot for commit 9fd4012. Bugbot is set up for automated code reviews on this repo. Configure here.

Wrangler >=4.44 defaults per-version Preview URLs to match the workers_dev
setting when preview_urls isn't set explicitly. This worker has
workers_dev: false, so every deploy (each branch build runs
'wrangler versions upload') reset Preview URLs back to disabled, requiring
a manual dashboard re-enable that the next build undid.

Set preview_urls: true so PR/branch preview URLs persist across deploys.
Enables preview URLs only — the production workers.dev route stays off.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 30, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
superwall-docs 9fd4012 Jun 30 2026, 07:13 PM

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.

1 participant