expo: [SDK32] undefined is not an object (evaluating '_expo2.default.KeepAwake')
Environment
Expo CLI 2.6.14 environment info: System: OS: macOS 10.14.2 Shell: 3.2.57 - /bin/bash Binaries: Node: 8.9.1 - /usr/local/bin/node Yarn: 1.7.0 - /usr/local/bin/yarn npm: 6.5.0 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman IDEs: Android Studio: 3.1 AI-173.4819257 Xcode: 10.1/10B61 - /usr/bin/xcodebuild npmPackages: expo: ^32.0.0 => 32.0.0 react: 16.5.0 => 16.5.0 react-native: https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz => 0.57.1 react-navigation: ^3.0.9 => 3.0.9 npmGlobalPackages: expo-cli: 2.6.14
I’m running my app in the Expo client (newly installed) in the iOS Simulator (iPhone 7).
Steps to Reproduce
I followed the upgrade path from SDK31 to SDK32.
Expected Behavior
I should be able to display my app in the Expo client.
Actual Behavior
My app seems to be running (I get logs in my terminal), but the simulator displays a red screen. Dismissing the screen doesn’t show the app. No “extra info”.
undefined is not an object (evaluating '_expo2.default.KeepAwake')
<unknown>
crna-entry.js:20:17
loadModuleImplementation
require.js:292:12
guardedLoadModule
require.js:179:45
global code
<unknown file>:0
Reproducible Demo
Sorry, I cannot share my project or a reproducible demo at this time.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 13
- Comments: 21 (4 by maintainers)
Looks like this was related to
react-native-scripts
for me. I fixed it by following the instructions after runningnpm start
.Change the
main
key tonode_modules/expo/AppEntry.js
then runnpm start -- -c
.I must have been using an old package.json setup 😅
I can confirm removing
react-native-scripts
and updatingmain
key resolves the issue.I got this issue, and my package.json doesn’t even have eact-native-scripts
In our application we are not importing
KeepAwake
module.Same error happen to me, upgrading from expo version 29 to 32.
I think the removal of
react-native-scripts
was the crucial part because thecrna-entry.js
was doingvar expo = require('expo');
.Hey @SK-DNS-NET and @leovazquezz1, Both SecureStore and Audio are no longer available in
expo
package. You need to install them byexpo install expo-secure-store
orexpo install expo-av
and import them from these packages instead ofexpo
.to me what solved it was importing the permissions and imagePicker like this:
import * as Permissions from 'expo-permissions';
import * as ImagePicker from 'expo-image-picker';
instead of this:
import Permissions from 'expo-permissions';
import ImagePicker from 'expo-image-picker';
same here
i have done all the above things but still facing the same issue