cf deploy --dry-run (and cf build) runs autoconfig and rewrites package.json/tsconfig.json on an already-configured Astro project (1.0.0-beta.5)
Summary
On a project that is already configured for Cloudflare, cf deploy --dry-run runs autoconfiguration and modifies tracked files, even though the build then fails. The project has a wrangler.jsonc, @astrojs/cloudflare installed, and cf in devDependencies. A --dry-run should not write to the working tree, and the changes it makes also break the project's own deploy script.
Versions
- cf 1.0.0-beta.5 (project devDependency, run via
npx cf) - astro 7.3.5, @astrojs/cloudflare 14.3.3, wrangler 4.142.0, npm, Linux
Repro
Fresh clone, npm ci, clean git status, then:
$ npx cf deploy --dry-run
Detected Project Settings:
- Worker Name: <name>
- Framework: Astro
- Build Command: npx astro build
- Output Directory: dist
📦 Install packages:
- cf (devDependency) # already a devDependency
📝 Update package.json scripts:
- "deploy": "cf deploy"
🛠️ Configuring project for Astro with "astro add cloudflare" # adapter already installed and configured
├ Build
│ Delegating to npx astro build
…
┌ Error
│ Build Output Specification: no root config found at …/.cloudflare/output/v0/config.json.
└
(The BOS error is cloudflare/cf#18.) Afterwards, git status shows:
M package-lock.json (~5,000 lines changed)
M package.json
M tsconfig.json
?? public/.assetsignore
package.json: the existing"deploy": "astro build && wrangler deploy"is overwritten with"deploy": "cf deploy", which cannot currently deploy this project (#18). It also adds"generate-types": "wrangler types"and bumpswranglerfrom^4.142.0to^4.144.0.tsconfig.json: it adds"./worker-configuration.d.ts"toincludeand reformats the whole file. The file doesn't exist in this project; it had been removed on purpose because its global types conflict with DOM types in client scripts.public/.assetsignore: it's created with_worker.jsand_routes.json, which look like Pages artifacts, in a Workers project.
The same happens with cf build.
Expected
--dry-runnever writes to the working tree. At most it prints what autoconfig would change.- Autoconfig is skipped, or asks first, when the project already has a Wrangler config and the framework adapter installed. Existing scripts (
deploy) are not overwritten. - Autoconfig doesn't add a
tsconfiginclude for a file that isn't generated.
Automated triage
Issue assessment
- Actionability: ✅ Actionable.
- Type: Bug.
- Reproduction: Skipped automatically.
- Labels:
bug(high)feature:auto-config(high)package:c3(medium)
Actionability and missing information
Bug with high confidence: cf 1.0.0-beta.5 deploy --dry-run (and build) runs autoconfig on an already-configured Astro project, overwriting the deploy script and tsconfig include and creating public/.assetsignore; actionable — versions, repro steps, and expected behavior are provided.
Reproduction reason: Reproduction was not attempted because this assessment is prohibited from reproducing the issue; the report gives clear steps and observed file changes a maintainer can follow.
This summary was generated by an LLM and may contain errors. Please verify its findings.
Triage bot commands and options
Repository collaborators with write or admin access can trigger actions by commenting on this issue:
@workers-devprod reproduce: Attempt to reproduce the issue using its description and recent comments.