Support RN SDK use in libraries
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, react-native
- Ambito
- mobile, observability
Direzione di ricerca
Inizia riproducendo il problema con React Native 0.71.11, Hermes, Metro e Sentry React Native SDK 6.2.0 su Android e iOS, utilizzando il callback beforeSend di Sentry.init e lo stacktrace di esempio. Traccia come vengono prodotti i nomi dei file di stacktrace.frames e definisci come risultato una distinzione affidabile tra libreria e client oppure una limitazione e un'alternativa documentate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
}
]
}
- Lingua principale
- TypeScript
- Stelle
- 1.8k
- Fork
- 369
- Merge medio
- 21h 3m
- PR unite (30g)
- 98
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di getsentry/sentry-react-native
-
sendDefaultPii is reported as deprecated on ReactNativeOptions although dataCollection is hiddenApertaBug React-Native Waiting for: Product Owner
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
getsentry/sentry-react-native#6830 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Android: turbo_module.* crash tags permanently pinned to RNSentry.initNativeReactNavigationNewFrameTracking (promise never settles)Forse già presa @antonis l’ha presa 2 giorni fa. ApertaBug React-Native
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
getsentry/sentry-react-native#6821 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
React-Native Replays Task
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
getsentry/sentry-react-native#6680 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Improvement React-Native
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
getsentry/sentry-react-native#6143 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
React-Native Task User Feedbacks
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
getsentry/sentry-react-native#5932 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di getsentry/sentry-react-native
Issue simili
-
bug ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
sleeyax/paseo-plugins#112 ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
rossoctl/serverless-harness#428 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
typesense/typesense-js#376 ·
-
ready sonnet zone:app
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
wheresrhys/totf#1103 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
prime-radiant-inc/evener#3726 ·
I maintainer di solito rispondono entro 1 giorno