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.

TypeError: Cannot read property 'createErrorBoundary' of undefined

See original GitHub issue

Following the Bugsnag Docs to config the project and run got this error from: const ErrorBoundary = Bugsnag.getPlugin('react').createErrorBoundary(React);

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:23 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
wildseansycommented, Jan 14, 2021

Can you please reference this in your documentation until this is released? I just spend 2-3 hours thinking I setup my app was wrong, meticulously looking at the docs, but it looks like this feature just doesn’t work at all with recent versions of react-native and bugsnag, even with the base case in the documentation.

3reactions
xljonescommented, Nov 6, 2020

Hey @adkenyon, we’re looking into a fix for this notifier side. But, in the meantime you can guard against this by checking whether the getPlugin() call returns undefined, and in these cases point your application to a no-op ErrorBoundary, for example:

class NoopErrorBoundary extends React.Component {
    // define your Noop Error Boundary here
}

var ErrorBoundary;
if (typeof Bugsnag.getPlugin('react') === 'undefined') {
    ErrorBoundary = NoopErrorBoundary;
} else {
    ErrorBoundary = Bugsnag.getPlugin('react').createErrorBoundary(React);
}

// use the ErrorBoundary as normal

When running without the debugger, Bugsnag will continue as normal with the Bugsnag error boundary.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React ErrorBoundary doesn't catch "cannot read properties of ...
But if I wrap a problematic place in the component, it works properly. const page = webtexts[courseId].pages[pageFamilyId]; // Returns undefined ...
Read more >
Cannot read property 'createErrorBoundary' of undefined
Following the Bugsnag Docs to config the project and run got this error from: const ErrorBoundary = Bugsnag.getPlugin('react').
Read more >
React integration guide - JavaScript - Bugsnag docs
You can set the user information of an error report using the user configuration property when Bugsnag starts or via an onError callback....
Read more >
Fix "Cannot read properties of undefined" error #shorts
Sometimes in Javascript you might have an array of objects like this and you to need to get some of the properties of...
Read more >
can not read properties of undefined - YouTube
Your browser can't play this video. ... can not read properties of undefined - reading createElement error in react.
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