undefined is not an object (evaluating 'ExponentNotifications.getExponentPushTokenAsync')
See original GitHub issueI 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:
- Created 6 years ago
- Reactions:4
- Comments:12 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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.