Repository navigation
docs(deployment): Sentry のセットアップ手順の誤りを直し、ウィザードの落とし穴を書く - #488
Merged
Merged
Conversation
実際にセットアップして分かった3点を反映する。 - **`VITE_SENTRY_RELEASE` はビルド変数に置いても展開されない**。値は文字列としてそのまま 環境変数になるため、`$WORKERS_CI_COMMIT_SHA` と書くとリテラルのその文字列が入る。 シェルで展開させるには build command 側に書く必要がある(#382 で書いた手順の誤り) - **Sentry のオンボーディングは TanStack Start 版・Cloudflare 版とも別プロジェクトを作る**。 両方通すと DSN が2つになる。フロントとサーバの失敗は同じ操作で連鎖する(#379)ので 1プロジェクトにまとめる方針を書く - **ウィザードの手順はそのまま使えない**。`@sentry/tanstackstart-react` は workerd の export condition が `@sentry/node` に解決されて Worker が起動しなくなる (getsentry/sentry-javascript#20038)。サーバ側の手順も Node 前提で Workers には無い。 必要なコードは実装済みで、ウィザードでやることは DSN とトークンの発行だけ あわせて、テスト用ボタンを足さずに収集を確認する手順(オフラインにして写真付きエントリを 保存する)を書く。AIクレジットを消費しない経路で、既存の計測点をそのまま踏める。 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HsQ32eXu1fcr1Vdz6r9RLc
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wine-preview | 79b76c0 | Commit Preview URL Branch Preview URL |
Aug 08 2026, 12:57 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
実際に Sentry のセットアップを進めて分かった3点を
docs/deployment.mdに反映する。ドキュメントのみの変更でコードは触っていない。1.
VITE_SENTRY_RELEASEはビルド変数に置いても展開されない(#382 で書いた手順の誤り)Workers Builds のビルド変数は値が文字列としてそのまま環境変数になるので、
$WORKERS_CI_COMMIT_SHAと書くとリテラルのその文字列がVITE_SENTRY_RELEASEに入る。シェルで展開させるには build command 側に書く必要がある:未設定でも収集は動く(アップロードしたソースマップとイベントを紐づけられなくなるだけ)ので、省略可であることも明記した。
2. オンボーディングはプラットフォームごとに別プロジェクトを作る
TanStack Start 版と Cloudflare 版の両方を通すと、DSN が2つになる(プロジェクトIDが別)。フロントとサーバの失敗は同じユーザ操作で連鎖することが多い(#379 がまさにそれ)ので、1プロジェクトにまとめて environment(
production/preview/local)で分ける方針を書いた。3. ウィザードの手順はそのまま使えない
@sentry/tanstackstart-reactは Worker を壊す。workerd/workerの export condition が@sentry/nodeを再エクスポートするファイルに解決され、"Cannot initialize ExportedHandler" で起動しなくなる(fix(tanstackstart-react): workerd/worker export conditions resolve to @sentry/node, breaking Cloudflare Workers getsentry/sentry-javascript#20038、closed as not planned)instrument.server.mjs/--import/NODE_OPTIONS/.output/serverといったサーバ側の手順はすべて Node 前提で、Workers には存在しないこの注意書きが無いと、次にセットアップする人(人でもエージェントでも)が同じ手順を踏んで Worker を壊す。
あわせて
テスト用ボタンを足さずに収集を確認する手順を書いた。DevTools を Offline にして
/cellar/newで写真付きエントリを保存 → オンラインに戻すとオフラインキューからTypeError: Failed to fetchが届く。既存の計測点をそのまま踏め、AIクレジットを消費しない。Test Plan
ドキュメントのみの変更。
bun run check通過。手順の妥当性は Sentry のセットアップを実際に進める中で確認する(
VITE_SENTRY_RELEASEの扱いは Workers Builds のビルド変数が文字列としてそのまま渡る仕様に基づく)。関連
サーバ側の予期しない例外を
@sentry/cloudflareのwithSentryで拾う件は #486 に切り出してある(本PRの対象外)。🤖 Generated with Claude Code
https://claude.ai/code/session_01HsQ32eXu1fcr1Vdz6r9RLc
Generated by Claude Code