fix: remove empty preview_image_url so the Deploy to Cloudflare button works - #9
Conversation
jrusso1020
left a comment
There was a problem hiding this comment.
No blockers. Correct, minimal, and the diagnosis holds up. Verified at head da0342a.
Verification
- Diff is exactly the claimed one line, and it sits mid-block between
docs_urlandicon_urls, so no trailing-comma breakage.package.jsonstill parses; I loaded it and dumped thecloudflareblock to confirm. preview_image_urlappears nowhere else in the repo.icon_urls: []is kept, as stated.- Upstream issue is real and matches — cloudflare/workers-sdk#14831, open, filed 2026-07-24, title describes exactly this misattributed-parse-error behavior.
- The bisection logic is sound and complete. The
icon_urls-removed control rules out the sibling field, and the final full-app test leavescategories: []andicon_urls: []in place while passing, which independently clears both empty collections. Sufficiency and necessity are both covered. - Single commit on the branch, no ridealong.
One accurate-framing note: the mechanism ("the template-metadata parser rejects the empty string") is inferred from black-box bisection, not read from source. preview_image_url returns zero hits in cloudflare/workers-sdk, consistent with the parser living in the closed-source dashboard rather than the SDK. That doesn't weaken anything here, the empirical case is strong and the fix has no downside, but it's why the upstream issue is the right call.
Suggestion, non-blocking: the assets you need already exist
The cloudflare block exists to render the template listing card, and this repo already has both pieces of art for it, currently unused by that block:
docs/preview.png— real 2400x1256 PNG, already rendered inREADME.md:5, and there's ascripts/screenshot.mjsthat regenerates itdocs/icon.svg— committed, whileicon_urlssits empty
So rather than only deleting the field, consider a follow-up that points both at their raw URLs:
"preview_image_url": "https://raw.githubusercontent.com/heygen-com/hyperframes-cloudflare-template/main/docs/preview.png",
"icon_urls": ["https://raw.githubusercontent.com/heygen-com/hyperframes-cloudflare-template/main/docs/icon.svg"],Worth doing separately, not here, and it needs the same fresh-subdirectory-path verification you describe, since a populated value is untested against the button and only the empty string is known-bad.
Cross-PR note
#10 (the TanStack Start rewrite) carries this same deletion in its own package.json hunk, so there's no regression risk whichever lands first. Expect a trivial overlap on that hunk if #10 rebases after this merges.
Ships the button fix at minimum cost. Good writeup on the caching gotcha too, that would have burned someone an hour.
— Rames Jusso
…bun (#15) * chore: adopt bun, oxlint, oxfmt and TypeScript 7 Follow-up to the review feedback on #10: add a linter and formatter, upgrade TypeScript, and move installs to bun. Tooling matches hyperframes-oss so the template stays consistent with the project it is a template for: `oxlint .` with `.oxlintrc.json`, `oxfmt .` reading `.prettierignore`, and a `bun.lock` in place of `package-lock.json`. TypeScript goes 5.9 -> 7.0.2. Typecheck, the vitest suite and the full client + SSR build all pass on it. package.json and wrangler.jsonc are excluded from the formatter. oxfmt wants to reorder package.json's top-level keys (relocating the whole `cloudflare` block) and to add trailing commas throughout wrangler.jsonc. Both are cosmetic for a spec-compliant parser, but the Deploy to Cloudflare button parses exactly those bytes and is demonstrably strict about them — an empty "preview_image_url": "" broke it in #9. Not worth the risk for no gain. The `npm run prepare-assets` chaining inside the dev/build/deploy scripts is left alone deliberately: it works under both bun and npm, whereas `bun run` there would hard-require bun for npm users. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * style: apply oxfmt across the tree Mechanical first run of the new formatter, kept as its own commit so the tooling change above stays readable. No behaviour changes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * ci: run lint, format, typecheck, test and build on bun Splits CI into three jobs so a formatting failure reports separately from a broken typecheck instead of hiding behind it: - lint: oxlint + oxfmt --check - check: typecheck, vitest, composition-manifest freshness - build: the vite client + SSR build, which nothing in CI covered before Installs move to `bun install --frozen-lockfile` via a SHA-pinned setup-bun, matching the existing pinning style. Test runs use `bun run test` rather than `bun test` so vitest is actually the runner. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Problem
The README's Deploy to Cloudflare button fails on this repo with:
Root cause
It isn't the Wrangler config. The button's template-metadata parser rejects the empty
"preview_image_url": ""inpackage.json's"cloudflare"block, and the dashboard misattributes the failure towrangler.jsonc. Filed upstream as cloudflare/workers-sdk#14831.This was isolated by bisection against
deploy.workers.cloudflare.comusing fresh subdirectory paths of a public fork (the button caches its pass/fail verdict per repo/path for 30+ minutes, ignoring new commits — so each experiment needs a fresh path):containers-template+ this repo's fullwrangler.jsonc(containers,standard-4, Dockerfile image, custom build, assets, R2, vars) → ✅ passespackage.json→ ❌ fails"cloudflare"block with onlypreview_image_urlremoved → ✅ passes; with onlyicon_urlsremoved (emptypreview_image_urlkept) → ❌ failswrangler.jsoncuntouched, only this line removed → ✅ button reaches the configure/provision step (project name, R2 bucket picker, binding descriptions all render correctly)Fix
Delete the empty
"preview_image_url": ""line (one-line diff).wrangler.jsonc— includinginstance_type: "standard-4"— needs no changes. The empty"icon_urls": []is harmless and kept.To add a real preview image later, set the field to an actual image URL; it's only the empty string that kills the flow.
Note for verifying after merge
Because of the verdict caching above, the button may keep showing the stale error on this repo's URL for a while after merging. Verify via a fresh checkout path (e.g. the repo URL once the cache expires, or immediately via a copy under a new path).