-
-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sentry.init()
is disabling require cycle warnings for the entire app it's integrated in
#3484
Comments
Sentry.init()
is disabling require cycle warnings for the entire app it's integrated in
Hey @liamjones - thank you for the detailed explanation and the reasoning, highly appreciated! I agree that this is not ideal and we will follow up here, but please be aware that due to PTOs and the holidays this will take a bit longer than usual. |
Thanks for the quick reply @kahest. No worries about the delay - I will |
Hi @liamjones, I believe the best way forward is to remove
|
@krystofwoldrich sounds sensible, 0.70 is already unsupported as far as RN is concerned: https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported From what I recall, |
OS:
Platform:
SDK:
@sentry/react-native
(>= 1.0.0)react-native-sentry
(<= 0.43.2)SDK version: 5.15.1
react-native
version: 0.72.8Are you using Expo?
Are you using sentry.io or on-premise?
If you are using sentry.io, please post a link to your issue so we can take a look:
N/A
Configuration:
(
@sentry/react-native
)I have the following issue:
When the client is initialised it tells RN's LogBox to ignore all require cycles in the app it's integrated with:
https://github.com/getsentry/sentry-react-native/blob/5.15.1/src/js/utils/ignorerequirecyclelogs.ts#L7
This is not something I was expecting as it is not
@sentry/react-native
's responsibility (hiding warnings for the rest of the app it's integrated with). In our case, this code was hiding require cycles we had in our code which we wanted to be informed about. Either this should be a much more specific ignore (since the code talks about afetch
require cycle specifically), be functionality that can be opted out of when initialising the SDK, or it should be removed entirely.For what it's worth, my recommendation is to remove it entirely. Metro has a resolver configuration option for ignoring specific require cycles and it defaults to ignoring everything under
node_modules
: https://metrobundler.dev/docs/configuration/#requirecycleignorepatterns. This has been present in Metro since 0.71.2: facebook/metro@100ca6f. I believe the default ignore pattern would already be hiding any Sentry<->RN<->fetch require cycle.Steps to reproduce:
Create a require cycle between two files:
Then import after
Sentry.init call
in your app.Observe metro's console log while loading the app
Actual result:
No output about require cycle
Expected result:
WARN Require cycle: path/to/a.ts -> path/to/b.ts -> path/to/a.ts
The text was updated successfully, but these errors were encountered: