Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở Phù hợp với người mới
#6,913 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
74/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, react-native, typescript
Lĩnh vực
build-system, tooling

Hướng nghiên cứu

Issue xác định isFromSentryBrowser trong dist/js/tools/metroconfig.js là nguyên nhân. Đọc hàm đó và chú thích SENTRY_BROWSER_FEEDBACK_WRAPPER_RE, sau đó so sánh cách xử lý originModulePath với dấu gạch chéo ngược của Windows và dấu gạch chéo xuôi của Unix. Công việc hoàn tất khi includeWebFeedback: false tạo stub cho cả hai mô-đun browser feedback trong bundle Windows và bundle khởi chạy thành công.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
1.8k
Fork
372
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
105

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của getsentry/sentry-react-native

Tất cả issue của getsentry/sentry-react-native

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.