Cloudflare deploy fails after adding a custom domain: generated comment is parsed as JSON
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- node.js, typescript
- 領域
- devops
調査の方向性
packages/void/src/cli/cf-build-output.tsと、generated-wrangler-config.tsにある既存のヘルパーreadGeneratedWranglerConfigFileを読みます。issueで挙げられている3つの設定読み込みを確認し、公開されたトラフィックスナップショットを含むvoid.lock.jsonのコメントで問題を再現します。デプロイ準備がJSONCコメントを受け入れ、カスタムドメインを保持すれば完了です。issueにはローカルでの回避策が報告されていますが、アップロードされたデプロイはありません。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 402
- フォーク
- 32
- 平均マージ
- 12時間 1分
- マージ済み PR(30日)
- 80
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
voidzero-dev/void のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
voidzero-dev/void#463 ·
メンテナーはふだん 1 日以内に返信
-
Deploy after a secret change fails for Workers over ~750 KB: source read-back capped at 1 MiB対応中かも @Brooooooklyn が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
voidzero-dev/void#459 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
voidzero-dev/void#428 ·
メンテナーはふだん 1 日以内に返信
-
Allow `npm create void` and `void init` to run without prompts対応中かも @ashunar0 が今日担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 57/100
voidzero-dev/void#491 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 53/100
voidzero-dev/void#486 ·
メンテナーはふだん 1 日以内に返信
voidzero-dev/void の issue をすべて見る
似ている issue
-
[Android] Nested transforms are composed in reverse order対応中かも @Danyalo が今日担当しました。 オープンRepro provided
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
software-mansion/react-native-svg#3090 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
radix-ui/primitives#4228 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
rocketride-org/rocketride-server#2705 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
archon-ready archon-size-s archon-type-bug area: web
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
coleam00/Archon#4707 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
HarperFast/grafana-datasource#177 ·