Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`cf deploy` duplicates the build step when `--prebuilt` flag is not used

Aperta
#183 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
typescript, vite

Direzione di ricerca

Start with the cf deploy and cf build command entry points and reproduce the behavior using the commands and Vite+ setup described in the issue. Compare how --prebuilt, existing .cloudflare/output/v0, and project build scripts are handled; done means the chosen behavior avoids an unintended duplicate build without breaking deployment.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

In Cloudflare's dashboard, "build" and "deploy" are two separate steps, and cf deploy builds automatically without setting --prebuilt. This is quite confusing when migrating from wrangler (e.g., a drop-in replacement of npx wrangler deploy with npx cf deploy) and causes several issues when the deploy command is set to pnpm|npx cf deploy:

  • It duplicates the build. cf runs its own build step again even when the build command was set and executed. Unnecessarily increases build time.
  • There is a risk of unexpected overwriting of object code when cf's chosen build script differs from the user's. This can be very difficult to debug in certain edge cases.
  • This behavior cannot be configured. Seems like cf detects the project layout and chooses the toolchain automatically. There is no config item to set a build script.
  • Specifically, for projects using Vite+, where vite was linked to npm:@voidzero-dev/[email protected] and the vite CLI was never installed, cf will attempt to invoke pnpm vite build and fail.
  • npx cf build works for Vite+, but at the cost of downloading Vite again via npx vite build. This also brings the risk of version disparity.

Possible solutions:

  • Add hints on unsetting the build script when using cf deploy.
  • Allow configuring the build script in cloudflare.config.ts, mirroring wrangler. This should also smooth migration from wrangler, although the targeted UX seems to be eliminating this option.
  • Maybe skip building automatically on deploy when .cloudflare/output/v0 exists. Of course, with a flag to enforce it, like --build.
  • Would appreciate it if cf could add support for Vite+.

Off topic: I love the new CLI, much beyond wrangler, and congrats to the team who shipped such a great tool!

Lingua principale
TypeScript
Stelle
916
Fork
53
Merge medio
19h 13m
PR unite (30g)
185

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cloudflare/cf

Tutte le issue di cloudflare/cf

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.