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.

Undefined is not an object app[componentName].bind

See original GitHub issue

Version info

React: 16.9.0

Firebase: 7.10.0

ReactFire: 2.0.2

Other (e.g. Node, browser, operating system) (if applicable):

Test case

I’m building an app with Expo and React Native. I’m trying to add analytics to the app but I’m having trouble just using the examples of the docs.

When my code gets to:

const analytics = useAnalytics();

An error appears:

undefined is not an object (evaluating 'app[componentName].bind')

This is at this line: https://github.com/FirebaseExtended/reactfire/blob/80b9431ceb7e584f70a52940085f24a5a5b667bd/reactfire/firebaseApp/sdk.tsx#L127

Expected behavior

Working.

Actual behavior

undefined is not an object (evaluating 'app[componentName].bind')
- node_modules/reactfire/cjs/index.js:220:45 in importSDK.then$argument_0
- node_modules/promise/setimmediate/core.js:37:14 in tryCallOne
- node_modules/promise/setimmediate/core.js:123:25 in setImmediate$argument_0
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:146:14 in _callTimer
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:194:17 in _callImmediatesPass
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:458:30 in callImmediates
* [native code]:null in callImmediates
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:407:6 in __callImmediates
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:143:6 in __guard$argument_0
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:384:10 in __guard
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:142:17 in __guard$argument_0
* [native code]:null in flushedQueue
* [native code]:null in invokeCallbackAndReturnFlushedQueue

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
jhuleattcommented, Mar 12, 2020

Thanks @alxhotel! Will look into this. It may be a problem with the Firebase JS SDK, in which case there may not be much we can do, but we’ll give it a shot.

FYI @jamesdaniels

0reactions
olawalejuwonmcommented, May 11, 2021

@alxhotel does the library work on expo?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unhandled JS Exception: TyperError: undefined is not an ...
I get the Error Unhandled JS Exception: TyperError: undefined is not an object (evaluating '_this.onPress.bind') in my iOS simulator.
Read more >
Binding syntax
The target of a data binding can be a property, an event, or an attribute name. Every public member of a source directive...
Read more >
Common Angular Errors And How To Fix Them
This error occurs when you reference a directive in a template that is not defined, not properly imported or when its export name...
Read more >
function.bind(), scopes, closures in Javascript
That's because the this in the forEach callback is not pointing to the AppComponent scope but to a newly created scope. The Solution....
Read more >
Data Binding in Angular DropDownList component
Checkout and learn about Data Binding in Angular DropDownList component of ... Otherwise, the selected item remains undefined. ... app.component.ts.
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