Cloudflare deploy fails after adding a custom domain: generated comment is parsed as JSON
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
- Área
- devops
Línea de trabajo
Lee packages/void/src/cli/cf-build-output.ts y el helper existente readGeneratedWranglerConfigFile en generated-wrangler-config.ts. Comprueba las tres lecturas de configuración mencionadas en el issue y luego reproduce el problema con un comentario en void.lock.json que contenga la instantánea de tráfico publicada. Se habrá terminado cuando la preparación del despliegue acepte el comentario JSONC y conserve el dominio personalizado; el issue describe una solución local, pero no un despliegue subido.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
void deploy fails after adding a Cloudflare custom domain. Void saves a comment in the generated configuration, then tries to read that file with JSON.parse.
Steps to reproduce
- Deploy an Astro app to your own Cloudflare account with
pnpm exec void deploy. - Attach a domain in that account with
pnpm exec void domain add example.com. - Commit the updated
void.lock.json. - Run
pnpm exec void deployagain, including from a fresh CI checkout.
The build completes, but deployment stops at:
◇ Preparing deployment...
■ Unexpected token '/', "// void:pu"... is not valid JSON
The expected result is a successful deployment with the custom domain preserved.
Cause
The domain command saves a published-traffic snapshot as a comment:
// void:published-traffic:v1:...
That comment is saved in void.lock.json's text field and restored into .void-wrangler.jsonc. The file is valid JSONC, which allows comments, but not strict JSON.
prepareCfFrameworkBuildOutput reads the file with JSON.parse. The same file also uses JSON.parse in prepareCfStaticBuildOutput and the legacy path of prepareCfBuildOutput.
Local workaround
I patched those three reads to use the existing readGeneratedWranglerConfigFile helper from generated-wrangler-config.ts. That helper already handles comments and rejects invalid input.
I reproduced the original parsing error locally. With the patch, the same Worker preparation step accepts the comment and produces deployment output. This check did not upload the Worker. A frozen-lockfile install also succeeds with the pnpm patch.
Versions
- Void: 1.1.11
- Astro: 7.4.0
@astrojs/cloudflare: 14.4.0- Failing CI environment: GitHub Actions, Linux, Node.js 24.21.0
The JSON.parse calls are also present on main at 43c7fe17e402d4509516796eec3e7c832a2b0630.
- 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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de voidzero-dev/void
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
voidzero-dev/void#463 ·
Los mantenedores suelen responder en 1 día
-
Deploy after a secret change fails for Workers over ~750 KB: source read-back capped at 1 MiBPosiblemente ocupada @Brooooooklyn la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
voidzero-dev/void#459 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
voidzero-dev/void#428 ·
Los mantenedores suelen responder en 1 día
-
Allow `npm create void` and `void init` to run without promptsPosiblemente ocupada @ashunar0 la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 57/100
voidzero-dev/void#491 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 53/100
voidzero-dev/void#486 ·
Los mantenedores suelen responder en 1 día
Todos los issues de voidzero-dev/void
Issues similares
-
[Android] Nested transforms are composed in reverse orderPosiblemente ocupada @Danyalo la tomó hoy. AbiertoRepro provided
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
software-mansion/react-native-svg#3090 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
radix-ui/primitives#4228 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
rocketride-org/rocketride-server#2705 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
archon-ready archon-size-s archon-type-bug area: web
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
coleam00/Archon#4707 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
HarperFast/grafana-datasource#177 ·