今日已更新 242 条资讯 | 累计 42300 条内容
关于我们

Shipping an image SaaS on Cloudflare Workers: nine things that broke

Jack Cooper 2026年09月12日 11:22 0 次阅读 来源:Dev.to

I spent a week building Album Art Creator , a tool that turns a song title into a release-ready cover: a picture from an image model, a title and artist name as live text layers, and a pre-flight check against what Spotify, Apple Music and the three big distributors publish. The whole thing runs on Cloudflare Workers — TanStack Start for the app, D1 for the database, R2 for the images, a payment provider for money, and four different image models behind it. Most of it went the way the docs said. These nine did not, and each one cost me an hour to a day. 1. TanStack Start instead of Next.js, because of what sits underneath I have shipped Next.js on Workers before, through OpenNext. Every Workers bug I had written down came from that translation layer: cron needed a hand-written custom worker, Node middleware was unsupported, auth occasionally lost its async-local-storage context, and the bundle limit was real. TanStack Start is Vite-native and Cloudflare ships a first-party plugin for it, so there is no translation layer to debug. The trade is maturity: it is still an RC, so when something breaks there is no Stack Overflow answer waiting. I pinned every version ( @tanstack/react-start 1.168.49, Vite 8.2.2, @cloudflare/vite-plugin 1.54.4, wrangler 4.129.0) and moved on. Plugin order matters and is easy to get wrong: cloudflare({ viteEnvironment: { name: 'ssr' } }) first, tanstackStart() second, react() third. 2. Cron silently did nothing until the entry point changed I added triggers.crons to wrangler.jsonc , exported a scheduled handler, deployed, and nothing ran. No error. The framework plugin aliases a virtual module to your src/server.ts , so during vite dev my entry looked live. But wrangler.jsonc still had main pointing at the framework's own server entry — an object with only fetch on it. My scheduled export was never part of the deployed worker. The fix is to own the entry: // src/server.ts — and wrangler.jsonc main must point HERE, not at the package entry im

本文内容来源于互联网,版权归原作者所有
查看原文