[SDK32] undefined is not an object (evaluating '_expo2.default.KeepAwake')

So you've been playing with package versions and suddenly hit a point where you see this weird error in a red screen

 

[SDK32] undefined is not an object (evaluating '_expo2.default.KeepAwake')

 

We've found this error to be related with react-native-scripts.

To fix it make the following changes in your package.json

  1. Change the "main" key in package.json to "./node_modules/expo/AppEntry.js"
  2. Replace 'react-native-scripts' with 'expo' in the 'scripts' config.
    Example:
    "scripts": {
    "start": "expo start",
    "eject": "expo eject",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "test": "jest"
    }
  3. yarn remove react-native-scripts
    Remove react-native-scripts from devDependencies.
  4. Run npm start -- -c or expo start -c (-c clears cache)

Did it work?

Have an idea?

Let us transform your idea into a Scalable Product

Phone

424-388-1279

Address

1450 2nd St, Santa Monica, CA 90401