question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react native expo:Bugsnag.getPlugin('react') returns undefined

See original GitHub issue

I have exactly followed the guidelines about installingbugsnag with a react native expo application. Now I would like to wrap my application inside (I cannot reproduce here the whole code due to complexity):

import Bugsnag from '@bugsnag/expo';
...
const ErrorBoundary = Bugsnag.getPlugin('react');

export const Application = () => (
  <ErrorBoundary>
    {"rest of my application"}
  </ErrorBoundary>
)

But when I run the app in debug mode, it crashes with ErrorBoundary not being a valid component: image.

I looked at a this similar issue. But it is about web react. Thank you for your advice.

Specs:

package.json

     "@bugsnag/expo": "^7.1.1",
     "expo": "~37.0.3",
    "react": "~16.9.0",
    "react-dom": "~16.9.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",

node version: v12.14.0 ios, physical device xr 10

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
ppeelmancommented, Aug 20, 2021

I had the same issue. I solved it by moving the getPlugin call within the component:

export default () => {
    const ErrorBoundary = Bugsnag.getPlugin('react').createErrorBoundary(React);

    return (
            <ErrorBoundary>
                <App/>
            </ErrorBoundary>
    )
}
3reactions
MahdiKarimipourcommented, Apr 28, 2021

I have the exact problem, not an import issue , the error boundary is undefined , as soon I removed it issue gone. so How can get ErrorBoundary in 7.1?

Any luck on this issue raised by @mariasierraloynaz ? I have followed your guide here, and I get the below error.

https://docs.bugsnag.com/platforms/react-native/expo/

TypeError: undefined is not an object (evaluating ‘_expo.default.getPlugin(‘react’).createErrorBoundary’)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bugsnag can't read notify of undefined react native
I have tried to follow all the react native setup from bugsnags docs, but obviously I am missing something. All help is appreciated....
Read more >
React Native integration guide - Bugsnag docs
The easiest way to add Bugsnag to your React Native project is to use our CLI (macOS and Linux only). Alternatively you can...
Read more >
bugsnag/plugin-react-native-unhandled-rejection - Yarn
This plugin hooks in to React Native's promise rejection tracking to provide unhandled exception reporting for Promises. It is included in the Expo...
Read more >
Text - React Native
Specifies the largest possible scale a font can reach when allowFontScaling is enabled. Possible values: null/undefined : inherit from the ...
Read more >
Strict Mode - React
StrictMode is a tool for highlighting potential problems in an application. Like Fragment , StrictMode does not render any visible UI.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found