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

includeWebFeedback: false leaves @sentry/browser's feedbackSync in bundles made on Windows, which then fail at launch

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, react-native, typescript

調査の方向性

issueでは、原因として dist/js/tools/metroconfig.js の isFromSentryBrowser が挙げられています。この関数と SENTRY_BROWSER_FEEDBACK_WRAPPER_RE のコメントを読み、WindowsのバックスラッシュとUnixのスラッシュで originModulePath の扱いを比較してください。includeWebFeedback: false によってWindowsバンドル内の両方のブラウザフィードバックモジュールがスタブ化され、バンドルが正常に起動すれば完了です。

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

説明

Bug React-Native Waiting for: Product Owner
Environment
  • @sentry/react-native 8.29.0 (the same code is in 8.31.0)
  • Expo SDK 57, React Native 0.86.3, Metro via getSentryExpoConfig
  • Bundled on Windows 11 (eas update, which bundles locally)
Steps to reproduce
  1. Use getSentryExpoConfig(__dirname, { includeWebFeedback: false }) in metro.config.js.
  2. On Windows, run npx expo export --platform ios --source-maps (or eas update).
  3. List the bundle's source map sources.
Expected result

As on macOS and Linux: @sentry/feedback is stubbed, and so are @sentry/browser's feedbackSync.js and feedbackAsync.js, as the comment above SENTRY_BROWSER_FEEDBACK_WRAPPER_RE describes.

Actual result

@sentry/feedback is stubbed, but @sentry/browser/build/npm/esm/prod/feedbackSync.js and feedbackAsync.js are bundled. feedbackSync.js calls buildFeedbackIntegration() from the empty module as it loads, so the bundle fails at launch. On an expo-updates update, the phone records a failed launch and falls back to its embedded bundle.

The cause is isFromSentryBrowser in dist/js/tools/metroconfig.js:

function isFromSentryBrowser(originModulePath) {
    return originModulePath.includes('@sentry/browser');
}

On Windows, Metro's context.originModulePath uses backslashes (...\node_modules\@sentry\browser\build\...), so this is never true. Matching either separator fixes it, for example /[\/]@sentry[\/]browser[\/]/.test(originModulePath).

Our workaround is to wrap config.resolver.resolveRequest after getSentryExpoConfig and return { type: 'empty' } for /\/feedback(Sync|Async)/ requested from a path matching that pattern.

主要言語
TypeScript
スター
1.8k
フォーク
372
平均マージ
1日 2時間
マージ済み PR(30日)
105

環境構築

はじめの一歩

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

getsentry/sentry-react-native のほかの issue

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

似ている issue

TypeScript の issue をもっと見る

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

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