Repository navigation
Description
Summary
cf build and cf deploy cannot build or deploy any Astro project in 1.0.0-beta.5. The Astro build succeeds, and then cf fails while reading the Build Output Specification (BOS), because the Astro build never writes one:
Build Output Specification: no root config found at
/home/user/project/.cloudflare/output/v0/config.json.
cf init on an Astro project explicitly advertises cf deploy as the next step, so this blocks the documented onboarding path.
Versions
cf1.0.0-beta.5 (npm i -g cf, latest published)- astro 7.3.5,
output: "static" - bun 1.4.2
- Tried also with
@astrojs/cloudflare14.3.3, and withoutput: "server"
Repro 1 — cf init on an existing Astro project
$ cf init .
● Setting up the existing project in /tmp/init-probe
Detected Project Settings:
- Worker Name: website
- Framework: Astro
- Build Command: bunx astro build
- Output Directory: dist
🛠️ Configuring project for Astro with "astro add cloudflare"
├ Next steps
│ cf dev Start a local development server
│ cf deploy Deploy to Cloudflare
$ cf deploy
├ Build
│ Delegating to bunx astro build
...
20:04:00 [build] Complete! # <- Astro build succeeds, 4 pages
┌ Error
│ Build Output Specification: no root config found at
│ /tmp/init-probe/.cloudflare/output/v0/config.json.
└
Repro 2 — cf migrate from wrangler.jsonc (assets only, no adapter)
Existing wrangler.jsonc (static assets, no Worker script):
{
"name": "website",
"compatibility_date": "2026-09-27",
"assets": { "directory": "./dist", "not_found_handling": "404-page" }
}$ cf migrate
✔ Migration complete. # generates cloudflare.config.ts + wrangler.config.ts
$ cf deploy --mode staging --dry-run
├ Build
│ Delegating to bunx astro build "--mode" "staging"
...
┌ Error
│ Build Output Specification: no root config found at
│ /home/user/project/.cloudflare/output/v0/config.json.
└
Repro 3 — explicit entrypoint in cloudflare.config.ts
export default defineConfig(({ mode }) => ({
worker: {
name: "website-staging",
entrypoint: "./src/worker.ts",
compatibilityDate: "2026-09-27",
assets: { notFoundHandling: "404-page" },
},
}));Same error. The entrypoint is never bundled, because cf never reaches the bundler step.
What does work
A project with only an assets directory and no framework dependency works end to end:
$ cf deploy --dry-run
├ Build
│ Delegating to Wrangler
◆ Build complete
├ Deploy
│ ✨ Read 1 file from the assets directory .../.cloudflare/output/v0/workers/default/assets
◆ Dry run complete
So the Wrangler/assets code path does produce a correct BOS. The problem is that it is unreachable as soon as a supported framework is detected.
Observations
-
The framework path is unconditional.
cf buildpicksbuildCommandfrom the detected framework and runs it, then requires a BOS. There is no flag, config key, or environment variable to fall back towrangler build/ the Vite plugin. For Astro this is always a dead end, because@astrojs/cloudflareis Wrangler-oriented: it writes.wrangler/deploy/config.json+dist/client/wrangler.json(a deferred-deploy config) and never writes a BOS — not inoutput: "static", not inoutput: "server". -
Astro is not registered as supported. In the autoconfig framework registry, Astro is
{ supportsCf: 0, supported: 0 }. Despite that,cf initruns the Astro autoconfig and printscf deployas the next step, which cannot work. -
cf initsilently moves the assets directory. Installing@astrojs/cloudflarechanges the Astro output dir fromdist/todist/client/, which silently invalidates an existingassets.directory: "./dist". -
The error message is the only signal. The build succeeds, then the user gets a BOS error that doesn't mention the framework or point at a workaround.
Expected behavior
Either
cf build/cf deployhandles the Astro adapter's deferred deploy config (.wrangler/deploy/config.json), orcf buildfalls back towrangler build(the assets path) when the framework build produces no BOS, orcf initrefuses Astro / omitscf deployfrom the next steps until it is supported, and says to keep using Wrangler.
Happy to send a PR for the fallback if that's the preferred direction.
Activity
nilay1221 commentedon Sep 29, 2026
Yes, I’m also facing the same issue with a fresh Next.js project configured with OpenNext. I reproduced it with Next.js 16.3.6 and
[email protected].Reproduction steps:
npm install --save-dev [email protected]
.../.cloudflare/output/v0/config.json.
SIGTERM-015 commentedon Sep 30, 2026
One more data point for Astro projects that use
@astrojs/cloudflarewith bindings, relevant once the BOS part is fixed.Versions: cf 1.0.0-beta.5, astro 7.3.5, @astrojs/cloudflare 14.3.3 (
output: "static"with someprerender = falseroutes), npm.cf migrate --bundler viteon awrangler.jsoncwithd1_databases,send_email,vars, andassets.run_worker_firstgenerates a correct-lookingcloudflare.config.ts. After resolving themigrations_dirTODO,bindings.d1(...),bindings.sendEmail({}),bindings.text(...),bindings.secret()andassets.runWorkerFirstare all there.But the Astro adapter still reads bindings only from
wrangler.jsonc. Ifwrangler.jsoncis removed after migrating,astro build(the commandcf builddelegates to) succeeds, but the generateddist/server/wrangler.jsonhas no bindings at all:{ "name": "…", "main": "entry.mjs", "d1_databases": [], "send_email": [], "vars": {}, "assets": { "binding": "ASSETS", "directory": "../client" } }run_worker_firstandnot_found_handlingare gone as well.So even with a BOS, the deployed Worker would silently lose D1, email and vars. It would also lose
run_worker_first, which makes the static-asset layer serve the 404 page for on-demand routes on navigation requests. For now the only working setup is to keepwrangler.jsoncand build and deploy with Wrangler. It might be worth makingcf migratewarn about this, or keepwrangler.jsonc, when@astrojs/cloudflareis detected.penalosa commentedon Sep 30, 2026
Astro should be fixed once this release goes out: withastro/astro#18117
build: switch from bun back to npm on Node 26 LTS
deploy: switch from Wrangler to cf deploy