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

`cf deploy` deletes plain-text vars set outside the config: no equivalent of `keep_vars`

Aperta
#197 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à
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
cli

Direzione di ricerca

Start with the deploy command and the upload builder mentioned in the issue, then trace how worker configuration is read and how cf migrate handles keep_vars. Add a keepVars configuration or deploy flag that preserves externally managed plain-text vars, and ensure migration maps keep_vars; verify with the existing deploy and migration tests, if present.

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

Descrizione

cf version: 1.0.0-beta.12

What happens

cloudflare.config.ts has no equivalent of Wrangler's keep_vars. cf migrate says so:

├─ [required] keep_vars: The keep_vars is not supported by the new config and was not migrated.
├─ [required] env.test.keep_vars: The keep_vars is not supported by the new config and was not migrated.

So after migrating, every cf deploy replaces the Worker's plain-text vars with what the config declares, and deletes any var set some other way: in the dashboard, over the API, or by another tool. In beta.12's dist, the upload builder takes keepVars, but the deploy command passes keepVars: void 0. cf deploy has no --var / --keep-vars flag either.

This is the vars half of #72, which covers secrets, where --secrets-file gives a workaround. Vars have no workaround.

Why it matters

Some projects deliberately keep runtime configuration as plain vars that are set outside the config file, so they stay readable on the Worker. In our case a separate operator tool writes them over the API, and the repo's wrangler.jsonc declares none of them, with keep_vars: true. With Wrangler, a deploy from a checkout ships code and leaves those values alone. With cf deploy, the same deploy would wipe every one of them. This blocks our migration.

Ask

A keepVars option on the worker config (or a --keep-vars deploy flag), matching Wrangler's keep_vars: true. Mapping keep_vars in cf migrate would follow from it.

Lingua principale
TypeScript
Stelle
853
Fork
42
Merge medio
17h 57m
PR unite (30g)
146

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.