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 (evaluating 'ExponentNotifications.getExponentPushTokenAsync')

See original GitHub issue

I have a problem (error message in title) when trying to run my expo (v42.0.0) project on a Genymotion-emulated Android Nexus 5. It seems to be caused by Notifications being imported by registerRootComponent.js, and more specifically by line 132 in Notifications.js:

// ...

import { DeviceEventEmitter, NativeModules, Platform } from 'react-native';
const { ExponentNotifications } = NativeModules;

// ...

export default {

  // ...

  // This line causes the error because ExponentNotifications is undefined.
  getExponentPushTokenAsync: ExponentNotifications.getExponentPushTokenAsync,

  // ...

}

The full error message is as follows:

undefined is not an object (evaluating 'ExponentNotifications.getExponentPushTokenAsync')
<unknown>
    Notifications.js:132:51
loadModuleImplementation
    require.js:174:12
guardedLoadModule
    require.js:126:36
_require
    require.js:110:24
<unknown>
    registerRootComponent.js:8
loadModuleImplementation
    require.js:174:12
guardedLoadModule
    require.js:126:36
_require
    require.js:110:24
registerRootComponent
    Expo.js:58:19
<unknown>
    crna-entry.js:61:15
loadModuleImplementation
    require.js:174:12
guardedLoadModule
    require.js:119:45
_require
    require.js:110:24
global code

PS

It works fine on iPhone.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
thomashagstromcommented, Aug 24, 2017

This occurs on a new project as @ziudeso said, when running on Android simuator. If later versions are required @CvBlixen ; of what packages? It’s high risk of incompatibility to just upgrade all packages.

4reactions
CvBlixencommented, Jun 28, 2017

I went through my package.json and pushed everything to later versions … and now it works.

I should have done that from the start. Sorry.

Read more comments on GitHub >

github_iconTop Results From Across the Web

undefined is not an object (evaluating's.NativeModules ...
When i remove the third line of App.js file, it's work perfectly. Can any one say me why this error appears? A newbie...
Read more >
ERROR TypeError: undefined is not an object (evaluating ...
Ever encountered this error → ERROR TypeError: undefined is not an object (evaluating '_this.props.navigation.navigate') whilst working hard on your project?
Read more >
[React Native] TypeError: undefined is not an object ...
Can you help me with this error? I am getting this error while trying to call sb.connect() TypeError: undefined is not an object...
Read more >
receiving [TypeError: undefined is not an object (evaluating ...
Currently building React Native (0.66) mobile using Mac, npm (6.14.13), Xcode w/mobile device simulator (iPhone 12, iOS 14.3) and trying to ...
Read more >
undefined is not an object (evaluating ... - Edward Beazer
undefined is not an object (evaluating 'RNGestureHandlerModule.State'). Error while installing React Navigation. Sun, 06 Jan 2019.
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