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

Support RN SDK use in libraries

Đang mở
#4,377 2 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, react-native
Lĩnh vực
mobile, observability

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện vấn đề với React Native 0.71.11, Hermes, Metro và Sentry React Native SDK 6.2.0 trên Android và iOS, sử dụng callback beforeSend của Sentry.init và stacktrace mẫu. Theo dõi cách tên tệp của stacktrace.frames được tạo ra và xác định kết quả hoàn thành là sự phân biệt đáng tin cậy giữa thư viện và client, hoặc một giới hạn và phương án thay thế được ghi lại.

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

Mô tả

Errors Feature React-Native
What React Native libraries do you use?

React Native without Frameworks

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

6.2.0

How does your development environment look like?

Sentry React Native SDK Version: 6.2.0
React Native Version: 0.71.11
Hermes Enabled: Yes
Platforms Tested: Android, iOS
Build Tools: Metro bundler

Sentry.init()
Sentry.init({
  dsn: 'https://[email protected]/library-project-id',
  release: '0.0.1',
  beforeSend(event) {
    // Attempting to filter errors based on stacktrace
    const isFromLibrary = event.exception?.values?.some((value) =>
      value.stacktrace?.frames?.some((frame) =>
        frame.filename?.includes('/node_modules/@my-library-name')
      )
    );

    return isFromLibrary ? event : null;
  },
});
Steps to Reproduce

I am unable to effectively filter errors in my React Native project using stacktrace.frames in the beforeSend callback. Despite providing proper logic to inspect the stack trace and filenames, the error events do not include sufficient information to reliably distinguish between errors originating from my project( my project is react native library ) and those from the client app.

This has become a critical issue for my project, where I am building a React Native SDK that will be integrated into client apps. I want to ensure that only errors from my SDK are sent to my Sentry project, while unexpected errors from client apps (using their own DSN and release) are excluded.

Expected Result
  • I expect the stacktrace.frames[].filename to include the library name or a clear identifier (e.g., node_modules/@my-library or similar) that shows where the error originates. This would make it much easier to filter errors specific to the project.
  • If this is not posible, is there another reliable way to distinguish between errors originating from the library and client app without relying solely on the stacktrace? Thanks
Actual Result

Stacktrace Does Not Contain library Identifiers:

The stacktrace.frames[].filename does not include a clear path to node_modules/@my/library-name or any other library-specific identifier.
Example stacktrace from a client app error:

"stacktrace": {
  "frames": [
    {
      "filename": "app:///Pressability.js",
      "function": "responderEventHandlers.onResponderRelease",
      "lineno": 525,
      "colno": 27
    },
    {
      "filename": "app:///index.js",
      "function": "TouchableOpacity.props.onPress",
      "lineno": 171,
      "colno": 27
    }
  ]
}
Ngôn ngữ chính
TypeScript
Star
1.8k
Fork
369
Merge trung bình
18 giờ 31 phút
Pull request đã merge (30 ngày)
100

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.