A tool decided my static site should be a server

My build succeeded, then the deploy step rewrote my config to add an SSR adapter, answered its own confirmation prompt, and failed. A short note on tools that mutate your source.

This site is static. Prerendered HTML, no server, nothing running at request time. It built cleanly on Cloudflare. 32 pages, all assets, no errors:

[build] 32 page(s) built in 8.78s
[build] Complete!
Success: Build command completed

Then the deploy step ran, and the deploy failed.

What happened

The deploy command was npx wrangler deploy. Finding no wrangler config in the repo, wrangler helpfully offered to set one up. In CI, where nothing can answer a prompt, it answered on my behalf:

<Term>from the build log
? Do you want to modify these settings?
🤖 Using fallback value in non-interactive context: no
? Proceed with setup?
🤖 Using fallback value in non-interactive context: yes
🛠️  Configuring project for Astro with &quot;astro add cloudflare&quot;
├ Updating configuration in /opt/buildhome/repo/astro.config.mjs

It edited my Astro config to add the Cloudflare SSR adapter, flipping the build from mode: "static" to mode: "server", then rebuilt. That second build died trying to bundle a native ELF binary (the rasteriser I use to generate OG images) into a Worker, where native code cannot run:

[commonjs--resolver] resvgjs.linux-x64-gnu.node (1:0):
  Unexpected character '\u{7f}'
  (Note that you need plugins to import files that are not JavaScript)

\u{7f} is the first byte of the ELF header. Rollup was trying to parse a shared object as JavaScript, because something upstream had decided my static site was a server.

The fix

Commit a config, so auto-config never runs:

{
  "name": "bblaker-com",
  "compatibility_date": "2026-09-08",
  "assets": {
    "directory": "./dist",
    "not_found_handling": "404-page"
  }
}

No main key. That's the load-bearing part. A main makes it a Worker with a script, which is exactly what the adapter exists to produce and what dragged the native binary into the bundle.

The actual complaint

I don't mind scaffolding tools. I mind two specific things.

A non-interactive default that says yes. "No prompt available" and "the user consents" are not the same fact. Defaulting to no and printing what it would have done costs nothing and fails safely. Defaulting to yes means the tool takes an irreversible-ish action precisely when nobody is watching.

A deploy step that edits source. deploy should be a read of the build output. Once it can rewrite astro.config.mjs, the artifact it ships is no longer the one my build produced or the one I tested. Here it was loud and it failed. The version that worries me is the one where it succeeds and I don't notice for a month what changed.

The tell was there in the log, incidentally: mode: "server" on a project that had said mode: "static" twenty lines earlier. Worth reading build logs even when they end in green.

#cloudflare #astro #ci #tooling