Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Cloudflare deploy fails with "binding X cannot be uploaded with pinned secrets" when Worker has a `ratelimits` binding and any secret

Abierto
#462 0 comentarios 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
57/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
cloud, devops

Línea de trabajo

Start in void/dist/deploy-DsW-PrRQ.mjs around bindingsFromOutput (about line 1806), where the issue says the binding type switch omits ratelimit; compare the existing cases with the suggested Workers API mapping. Then find the relevant deploy tests and add coverage for a Worker with a ratelimits binding and an existing secret using the pinned uploader. Done means that deployment succeeds and preserves the secret.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Versions

  • void 1.1.11, @void/deploy-cloudflare 1.1.11 (latest on npm as of 2026-10-16)
  • void deploy --platform cloudflare (direct Cloudflare target), Node 24, Workers Builds and local

Repro

  1. Project with a rate limit binding in void.config.ts:
    cloudflare: {
      ratelimits: [
        { name: "MY_RATE_LIMIT", namespace_id: "1001", simple: { limit: 30, period: 60 } },
      ],
    }
    
  2. void deploy --platform cloudflare → succeeds (Worker has no secrets yet).
  3. Set any Worker secret (void secret put FOO, or wrangler/cf workers secrets put).
  4. void deploy --platform cloudflare again → fails:
    ■ deploy: Cloudflare Worker Version upload failed (exit 1); production traffic is unchanged.
      Cloudflare binding MY_RATE_LIMIT cannot be uploaded with pinned secrets.
    
    Every subsequent deploy fails the same way while any secret exists.

Root cause

  • @void/deploy-cloudflare/dist/index.mjs (activateCloudflareVersionWithSecretsFile, ~L1354): when the active version has any secret and no candidate secrets file is passed, Void calls pinActiveSecrets and routes the upload through uploadPinnedCloudflareVersion.
  • That uploader builds bindings with bindingsFromOutput (void/dist/deploy-DsW-PrRQ.mjs ~L1806–1981), whose switch handles text, json, kv, d1, r2, durable-object, queue, ai, browser, images, hyperdrive, worker, workflow, send-email, analytics-engine-dataset, vectorize, dispatch-namespace, assets, version-metadata — but has no ratelimit case, so it hits default: throw new Error(\Cloudflare binding ${name} cannot be uploaded with pinned secrets.`)`.
  • Before the first secret, the normal wrangler versions upload --prebuilt path is used, which supports ratelimits — hence it only breaks once a secret exists.

Expected

Deploy succeeds and preserves existing secrets, as it does for other binding types.

Suggested fix

Add a ratelimit case to bindingsFromOutput mapping to the Workers API binding:

case "ratelimit":
  bindings.push({
    name,
    type: "ratelimit",
    namespace_id: requiredString(value.namespaceId ?? value.namespace_id, name),
    simple: { limit: value.simple.limit, period: value.simple.period },
  });
  break;

(plus a test: Worker with ratelimits + an existing secret deploys via the pinned uploader). It may be worth auditing the switch against all binding types Void can emit (e.g. secrets_store_secrets, mtls_certificates, worker_loaders), and failing in a pre-upload check rather than mid-deploy.

Workaround

Remove ratelimits from the config (or delete all Worker secrets) to deploy.

Lenguaje dominante
TypeScript
Estrellas
402
Forks
32
Merge medio
12 h 1 min
PR fusionados (30 d)
80

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de voidzero-dev/void

Todos los issues de voidzero-dev/void

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.