Expo - Failed to compile - Can't resolve '../Utilities/Platform'

Viewed 261

I'm using Expo SDK v41 and running into an error while launching Expo web:

Failed to compile. /var/www/myapp/node_modules/react-native/Libraries/StyleSheet/processColor.js Module not found: Can't resolve '../Utilities/Platform' in '/var/www/myapp/node_modules/react-native/Libraries/StyleSheet'

The folder /var/www/myapp/node_modules/react-native/Libraries/Utilities does exist:

$> /var/www/myapp/node_modules/react-native/Libraries/Utilities$ ls -la | grep -i 'platform'
-rw-rw-r--  1 myuser myuser   875 Oct 26  1985 NativePlatformConstantsAndroid.js
-rw-rw-r--  1 myuser myuser   802 Oct 26  1985 NativePlatformConstantsIOS.js
-rw-rw-r--  1 myuser myuser  1404 Oct 26  1985 Platform.android.js
-rw-rw-r--  1 myuser myuser  1508 Oct 26  1985 Platform.ios.js

I tried multiple things with no luck:

  1. Deleting packages-lock.json and reinstalling
  2. Updating packages to the latest versions
  3. Making sure packages used are compatible w/ Expo SDK v41
  4. Updating expo-cli to the latest version
  5. Running this script to add the missing Platform.js file

It looks like some people are having this issue using @react-native-community/viewpager but I'm not using this package and it's not in my dependencies either.

Expo Diagnostics

Expo CLI 4.7.2 environment info:
System:
  OS: Linux 5.4 Ubuntu 20.04.2 LTS (Focal Fossa)
  Shell: 5.0.17 - /bin/bash
Binaries:
  Node: 12.16.2 - /usr/local/bin/node
  Yarn: 1.22.5 - /usr/bin/yarn
  npm: 7.19.0 - /usr/local/bin/npm
npmPackages:
  expo: ^41.0.1 => 41.0.1 
  react: 16.13.1 => 16.13.1 
  react-dom: 16.13.1 => 16.13.1 
  react-native: 0.63.2 => 0.63.2 
  react-native-web: ~0.13.12 => 0.13.18 
npmGlobalPackages:
  expo-cli: 4.7.2
Expo Workflow: managed
0 Answers
Related