includeWebFeedback: false leaves @sentry/browser's feedbackSync in bundles made on Windows, which then fail at launch
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 74/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, react-native, typescript
- 領域
- build-system, tooling
調査の方向性
issueでは、原因として dist/js/tools/metroconfig.js の isFromSentryBrowser が挙げられています。この関数と SENTRY_BROWSER_FEEDBACK_WRAPPER_RE のコメントを読み、WindowsのバックスラッシュとUnixのスラッシュで originModulePath の扱いを比較してください。includeWebFeedback: false によってWindowsバンドル内の両方のブラウザフィードバックモジュールがスタブ化され、バンドルが正常に起動すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Environment
@sentry/react-native8.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
- Use
getSentryExpoConfig(__dirname, { includeWebFeedback: false })inmetro.config.js. - On Windows, run
npx expo export --platform ios --source-maps(oreas update). - 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
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
getsentry/sentry-react-native のほかの issue
-
React-Native Replays Task
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
getsentry/sentry-react-native#6680 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Improvement React-Native
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
getsentry/sentry-react-native#6143 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
React-Native Task User Feedbacks
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
getsentry/sentry-react-native#5932 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
React-Native Replays Task
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
getsentry/sentry-react-native#5882 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Good First Issue React-Native Task
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
getsentry/sentry-react-native#5771 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
getsentry/sentry-react-native の issue をすべて見る
似ている issue
-
area:editor bug issue-form:bug P0 platform:windows review: low
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
1lck/Lithe-IDEA#1388 ·
メンテナーはふだん 1 日以内に返信
-
fix(api): isToolAuditEnabled swallows database read errors on auditToolOperations without loggingオープンarea: backend bug priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
snapotter-hq/SnapOtter#3238 ·
メンテナーはふだん 1 日以内に返信
-
rig up --plan times out after 5 s and reports an UNKNOWN outcome while the daemon completes the planオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
modelcontextprotocol/servers#5216 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信