Skip to content
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

Support Sentry React Native for react-native-macos #1813

Open
thefinnomenon opened this issue Oct 6, 2021 · 6 comments
Open

Support Sentry React Native for react-native-macos #1813

thefinnomenon opened this issue Oct 6, 2021 · 6 comments
Labels
Platform: React-Native up-for-grabs ✋ We would really appreciate anyone interested in working on this to submit a PR!

Comments

@thefinnomenon
Copy link

Environment

How do you use Sentry?
Sentry SaaS (sentry.io)

Which SDK and version?
@sentry/react-native 3.1.1

Steps to Reproduce

  1. yarn add @sentry/react-native
  2. npx @sentry/wizard -i reactNative -p ios
  3. pod install
  4. react native macos

Expected Result

The Mac app builds and reports errors to Sentry.

Actual Result

/Users/finn/Projects/react-native-universal-monorepo/packages/macos/node_modules/@sentry/react-native/ios/RNSentry.m:75:44: error: no known instance method for selector 'applicationState'
    if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateActive && !sentHybridSdkDidBecomeActive && sentryOptions.enableAutoSessionTracking) {
                                           ^~~~~~~~~~~~~~~~
In module 'AppKit' imported from /Users/finn/Projects/react-native-universal-monorepo/packages/macos/macos/Pods/Headers/Public/React-Core/React/RCTUIKit.h:124:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:137:12: note: receiver is instance of class declared here
@interface NSApplication : NSResponder <NSUserInterfaceValidations, NSMenuItemValidation, NSAccessibilityElement, NSAccessibility>
           ^
/Users/finn/Projects/react-native-universal-monorepo/packages/macos/node_modules/@sentry/react-native/ios/RNSentry.m:75:65: error: use of undeclared identifier 'UIApplicationStateActive'
    if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateActive && !sentHybridSdkDidBecomeActive && sentryOptions.enableAutoSessionTracking) {
                                                                ^
/Users/finn/Projects/react-native-universal-monorepo/packages/macos/node_modules/@sentry/react-native/ios/RNSentry.m:75:44: error: no known instance method for selector 'applicationState'
    if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateActive && !sentHybridSdkDidBecomeActive && sentryOptions.enableAutoSessionTracking) {
                                           ^~~~~~~~~~~~~~~~
In module 'AppKit' imported from /Users/finn/Projects/react-native-universal-monorepo/packages/macos/macos/Pods/Headers/Public/React-Core/React/RCTUIKit.h:124:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:137:12: note: receiver is instance of class declared here
@interface NSApplication : NSResponder <NSUserInterfaceValidations, NSMenuItemValidation, NSAccessibilityElement, NSAccessibility>
           ^
/Users/finn/Projects/react-native-universal-monorepo/packages/macos/node_modules/@sentry/react-native/ios/RNSentry.m:179:30: error: property 'isFramesTrackingRunning' not found on object of type 'PrivateSentrySDKOnly'
    if (PrivateSentrySDKOnly.isFramesTrackingRunning) {
                             ^
/Users/finn/Projects/react-native-universal-monorepo/packages/macos/node_modules/@sentry/react-native/ios/RNSentry.m:180:59: error: property 'currentScreenFrames' not found on object of type 'PrivateSentrySDKOnly'
        SentryScreenFrames *frames = PrivateSentrySDKOnly.currentScreenFrames;
                                                          ^
/Users/finn/Projects/react-native-universal-monorepo/packages/macos/node_modules/@sentry/react-native/ios/RNSentry.m:187:61: error: property 'total' cannot be found in forward class object 'SentryScreenFrames'
            @"totalFrames": [NSNumber numberWithLong:frames.total],
                                                     ~~~~~~ ^
In file included from /Users/finn/Projects/react-native-universal-monorepo/packages/macos/node_modules/@sentry/react-native/ios/RNSentry.m:9:
In file included from /Users/finn/Projects/react-native-universal-monorepo/packages/macos/macos/Pods/Headers/Private/Sentry/Sentry.h:9:
/Users/finn/Projects/react-native-universal-monorepo/packages/macos/macos/Pods/Headers/Private/Sentry/PrivateSentrySDKOnly.h:5:68: note: forward declaration of class here
@class SentryEnvelope, SentryDebugMeta, SentryAppStartMeasurement, SentryScreenFrames;
                                                                   ^
/Users/finn/Projects/react-native-universal-monorepo/packages/macos/node_modules/@sentry/react-native/ios/RNSentry.m:188:62: error: property 'frozen' cannot be found in forward class object 'SentryScreenFrames'
            @"frozenFrames": [NSNumber numberWithLong:frames.frozen],
                                                      ~~~~~~ ^
In file included from /Users/finn/Projects/react-native-universal-monorepo/packages/macos/node_modules/@sentry/react-native/ios/RNSentry.m:9:
In file included from /Users/finn/Projects/react-native-universal-monorepo/packages/macos/macos/Pods/Headers/Private/Sentry/Sentry.h:9:
/Users/finn/Projects/react-native-universal-monorepo/packages/macos/macos/Pods/Headers/Private/Sentry/PrivateSentrySDKOnly.h:5:68: note: forward declaration of class here
@class SentryEnvelope, SentryDebugMeta, SentryAppStartMeasurement, SentryScreenFrames;
                                                                   ^
/Users/finn/Projects/react-native-universal-monorepo/packages/macos/node_modules/@sentry/react-native/ios/RNSentry.m:189:60: error: property 'slow' cannot be found in forward class object 'SentryScreenFrames'
            @"slowFrames": [NSNumber numberWithLong:frames.slow],
                                                    ~~~~~~ ^
In file included from /Users/finn/Projects/react-native-universal-monorepo/packages/macos/node_modules/@sentry/react-native/ios/RNSentry.m:9:
In file included from /Users/finn/Projects/react-native-universal-monorepo/packages/macos/macos/Pods/Headers/Private/Sentry/Sentry.h:9:
/Users/finn/Projects/react-native-universal-monorepo/packages/macos/macos/Pods/Headers/Private/Sentry/PrivateSentrySDKOnly.h:5:68: note: forward declaration of class here
@class SentryEnvelope, SentryDebugMeta, SentryAppStartMeasurement, SentryScreenFrames;
                                                                   ^

The following build commands failed:
        CompileC /Users/finn/Library/Developer/Xcode/DerivedData/reactnativeuniversalproject-gykikrnpgrtjeaearbpvhvmvlubz/Build/Intermediates.noindex/Pods.build/Debug/RNSentry-macOS.build/Objects-normal/x86_64/RNSentry.o /Users/finn/Projects/react-native-universal-monorepo/packages/macos/node_modules/@sentry/react-native/ios/RNSentry.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'RNSentry-macOS' from project 'Pods')
(1 failure)
@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2021

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@marandaneto
Copy link
Contributor

similar to #1407
RN and Desktop Support

@marandaneto
Copy link
Contributor

@jennmueng just to confirm, we dont support macOS right

@roxk
Copy link

roxk commented Feb 22, 2022

@marandaneto Do maintainers intend to at least support enableNative: false scenario? Right now adding RN sentry to the project causes the build to fail. Since I only need to capture errors in js, I can submit a PR adding API availability guard around the offending calls in RNSentry.m just to make it compile in macOS. That should make react-native-macos at least reach feature parity with react-native-windows. Thanks!

@marandaneto marandaneto added the up-for-grabs ✋ We would really appreciate anyone interested in working on this to submit a PR! label Feb 22, 2022
@marandaneto
Copy link
Contributor

marandaneto commented Feb 22, 2022

@roxk We do have the intention in the future if it gets enough traction, but it has not been prioritized yet.
PR would be welcomed :)

Context: https://github.com/microsoft/react-native-macos#readme

@marandaneto marandaneto changed the title does this library support react-native-macos? Support Sentry React Native for react-native-macos Mar 11, 2022
@marandaneto marandaneto moved this from Needs Discussion to Backlog in Mobile & Cross Platform SDK Mar 11, 2022
@marandaneto marandaneto mentioned this issue May 4, 2022
7 tasks
@krystofwoldrich
Copy link
Member

We currently test react-native-macos in our CI, what's missing to make the support official?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: React-Native up-for-grabs ✋ We would really appreciate anyone interested in working on this to submit a PR!
Projects
Status: Backlog
Development

No branches or pull requests

8 participants