Sentry-react-native: ReferenceError: Can't fin variable: performance

Created on 18 Sep 2020  Â·  9Comments  Â·  Source: getsentry/sentry-react-native

OS:

  • [ ] Windows
  • [X] MacOS
  • [ ] Linux

Platform:

  • [X] iOS
  • [ ] Android

SDK:

  • [X] @sentry/react-native (>= 1.0.0)
  • [ ] react-native-sentry (<= 0.43.2)

SDK version: ^1.8.1
react native version: 0.61.5
Node.js version: 14.11.0
react native cli version: 4.13.0

Are you using Expo?

  • [ ] Yes
  • [X] No

Are you using sentry.io or on-premise?
I don't know what is Sentry on-premise...

  • [ ] sentry.io (SaaS)
  • [ ] on-premise

If you are using sentry.io, please post a link to your issue so we can take a look:

There is no an issue
Configuration:

(@sentry/react-native)

Sentry.init({
  dsn: 'https://[email protected]/...'
});

I have following issue:

When I try to run my React Native app, I get the following error: ReferenceError: Can't fin variable: performance

If I click in the top stack items I can see this fragment of code:

function getReactNativePerformanceWrapper() {
    var INITIAL_OFFSET = performance.now(); // <-- This performance does not exists
    return {
        now: function () {
            return performance.now() - INITIAL_OFFSET;
        },
        timeOrigin: INITIAL_TIME,
    };
}

The above code are in node_modules > @sentry > utils > dist > misc.js

Actual result:

Screenshot 2020-09-18 at 13 52 16

Expected result:

I expect the app works fine like yesterday

All 9 comments

same here. Works yesterday et today, error...

@nickdemers try to restore the yarn.lock of yesterday and run yarn install —-frozen-lockfile

this temporally fix works for us.

@icastillejogomez @nickdemers
This was a mistake as we didn't add a check for RN <0.63 without performance being defined. You can fix this for now by downgrading to 1.8.0

But why in versión 1.4.5 also fails? Thank you for your for response

@icastillejogomez You might need to delete your node_modules and reinstall

versión with the fix?

When will be available on npm registry?

Available on npm registry and works as expected. Thank you all!

Was this page helpful?
0 / 5 - 0 ratings