Support RN SDK use in libraries
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Bug
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- javascript, react-native
- Bereich
- mobile, observability
Rechercherichtung
Beginne damit, das Problem mit React Native 0.71.11, Hermes, Metro und Sentry React Native SDK 6.2.0 unter Android und iOS zu reproduzieren, wobei der beforeSend-Callback von Sentry.init und der Beispiel-Stacktrace verwendet werden. Verfolge, wie die Dateinamen von stacktrace.frames erzeugt werden, und definiere als Abschluss entweder eine zuverlässige Unterscheidung zwischen Bibliothek und Client oder eine dokumentierte Einschränkung und Alternative.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
}
]
}
- Vorherrschende Sprache
- TypeScript
- Sterne
- 1.8k
- Forks
- 371
- Ø Merge
- 1 T. 6 Std.
- Gemergte PRs (30 T.)
- 115
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus getsentry/sentry-react-native
-
React-Native Replays Task
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
getsentry/sentry-react-native#6680 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Improvement React-Native
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
getsentry/sentry-react-native#6143 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
React-Native Task User Feedbacks
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
getsentry/sentry-react-native#5932 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
React-Native Replays Task
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
getsentry/sentry-react-native#5882 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Good First Issue React-Native Task
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 65/100
getsentry/sentry-react-native#5771 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in getsentry/sentry-react-native
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 84/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
keptinventory/kept#336 ·
Maintainer antworten meist innerhalb von 1 Tag
-
good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
-
hemi-earn
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
vetro-protocol/vetro-monorepo#1013 ·
Maintainer antworten meist innerhalb von 1 Tag