Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Loader stub silently drops calls outside queued method list, which results in either silent no-ops

オープン 初心者向け
#21,806 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
javascript, typescript
領域
frontend

調査の方向性

まず packages/browser-integration-tests/fixtures/loader.js を読み、ロード前のメソッドキューを追跡してから、そのエントリを packages/core/src/integration.ts の addIntegration 実装と比較します。ロード後にキューに入れられた呼び出しがどのように再実行されるかを確認し、選択したガードレールが既存のキュー内メソッドを変更せずに addIntegration を処理することを検証します。

索引モデルが issue の本文から書いたものです。

説明

Feature Package-Meta: Loader
Problem Statement

Problem

The CDN loader stub only queues a fixed set of SDK methods pre-load (init, addBreadcrumb, captureMessage, captureException, captureEvent, configureScope, withScope, showReportDialog). Any SDK call outside this list — such as addIntegration — is silently absent on the window.Sentry proxy before the full bundle loads, causing either silent no-ops or runtime crashes depending on timing.

The correct workaround is wrapping such calls in Sentry.onLoad(...), but the loader provides no mechanism to enforce this, making it easy to write code that works in development (where the bundle may already be loaded) but crashes in production.

Current Behavior

  • Unrecognized calls on the pre-load proxy are undefined — calling them throws or silently does nothing
  • addIntegration is a notable gap: it is a common post-init call pattern that the loader stub does not queue

Gap

  • No TypeScript or runtime guardrail prevents calling unqueued methods before onLoad
  • The failure mode is timing-dependent and hard to reproduce locally
Solution Brainstorm

Options

  1. Extend the queued method list — add addIntegration (and other commonly used post-init methods) to the pre-load queue so they are replayed after the bundle loads, consistent with how init is handled
  2. Catch-all no-op proxy — intercept any unrecognized property access pre-load and return a no-op function; prevents crashes but silently swallows calls
  3. Catch-all replay proxy — queue all unrecognized calls (not just the fixed list) and attempt replay post-load; broader coverage but requires more careful handling of methods with return values

Option 1 is the lowest-risk and most targeted fix. Option 3 is the most ergonomic for callers but adds complexity to the replay logic.

Additional Context

References

  • Loader stub source: packages/browser-integration-tests/fixtures/loader.js
  • addIntegration implementation: packages/core/src/integration.ts
Priority

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

主要言語
TypeScript
スター
8.7k
フォーク
1.9k
平均マージ
1日 16時間
マージ済み PR(30日)
576

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

getsentry/sentry-javascript のほかの issue

getsentry/sentry-javascript の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。