newrelic-experimental / NewRelicReactNativeModule

Experimental module for mobile applications built with React Native.
Apache License 2.0
30 stars 7 forks source link

Null is not an object #8

Open jeremiahlachica opened 3 years ago

jeremiahlachica commented 3 years ago

I was able to setup iOS and Android. When I visit the portal (one.newrelic.com), data is present like App Launches, HTTP response times, HTTP errors and network failure rate.

But when I try to call nrRecordMetric I get this error: null is not an object (evaluating '_NewRelicRNModule.default.recordMetric')

Not sure if this is related to this open issue. I tried renaming from: module.exports = NativeModules.NewRelicRNModule;

to

module.exports = NativeModules.NewRelicModule;

But it didn't work.

I noticed the required React Native version is 0.60 (I'm using 0.59.8) maybe it's not compatible? . Not sure if I'm missing something else. Please help.

Sowed commented 3 years ago

@jeremiahlachica also stuck around that. Did you manage to fix it?

I am trying to set up custom logs for screen names and stuff like that. The problem for me seems to be stemming around this NativeModules.NewRelicRNModule as logging NativeModules confirms it's an empty object making NewRelicRNModule a null.

So whatever is exported by module.exports = NativeModules.NewRelicModule; is always a null. Seems like the NativeModules setup is somehow broken.

CDBridger commented 2 years ago

+1 having this exact same issue too and commented over on that issue as well.

jacksonsmith commented 2 years ago

Same here, look like the bridge is not working...

Anyone already fixed it 🤦 ? i'm so struggle on that.

@Sowed @jeremiahlachica @CDBridger @MichaelOsowski @azeazasloper

jacksonsmith commented 2 years ago

Hello everyone.

I could fix, changing NewRelicModule.js file.

I verified that bridge works well, so that problem was the way we were getting from React Bridge Library.

Makes sense this, works for anyone else ?

`import {NativeModules} from 'react-native';

const {NewRelicModule} = NativeModules;

export default NewRelicModule; `

Sowed commented 2 years ago

@jacksonsmith I haven't tried that. Will update you with my status.