expo: ios Project fails with `The hashAssetFiles Metro plugin is not configured`

READ THIS FIRST

Hello! If you are currently experiencing this issue on a newly ejected project, please try upgrading expo-cli to the latest version (npm install -g expo-cli) and re-running expo eject.

🐛 Bug Report

On a fresh, bare typescript expo project, I get the error: The hashAssetFiles Metro plugin is not configured. You need to add a metro.config.js to your project that configures Metro to use this plugin

Environment

Expo CLI 3.20.0 environment info: System: OS: macOS Mojave 10.14.6 Shell: 3.2.57 - /bin/bash Binaries: Node: 10.19.0 - /usr/local/bin/node Yarn: 1.22.0 - ~/.yarn/bin/yarn npm: 6.13.4 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman IDEs: Android Studio: 3.5 AI-191.8026.42.35.6010548 Xcode: 11.3.1/11C505 - /usr/bin/xcodebuild npmPackages: expo: ~37.0.3 => 37.0.10 react: ~16.9.0 => 16.9.0 react-dom: ~16.9.0 => 16.9.0 react-native: ~0.61.5 => 0.61.5 react-native-web: ~0.11.7 => 0.11.7 npmGlobalPackages: expo-cli: 3.20.0

Steps to Reproduce

  1. create the project expo init and choose unmanaged bare typescript template
  2. run pod install from the ios folder
  3. run yarn ios

Expected Behavior

yarn ios should build without incident

Actual Behavior

Build fails with this message: [redacted]

Reproducible Demo

~https://github.com/joshglenn/expo-issue-may-13~ this does not reproduce the reported issue

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 29 (7 by maintainers)

Most upvoted comments

same here, tried it with a fresh install as well

repro steps:

$ expo init <project-name>
$ expo eject
$ yarn ios
$ <metro error>

hi! this does not fail for me. is it possible that you have a react-native packager instance running from a separate project?

also getting this after expo eject

warning: The iOS Simulator deployment target ‘IPHONEOS_DEPLOYMENT_TARGET’ is set to 6.0, but the range of supported deployment target versions is 8.0 to 13.2.99. (in target ‘libwebp’ from project ‘Pods’)

@byCedric @brentvatne I can confirm that a fresh install as illustrated in https://github.com/expo/expo/issues/8294#issuecomment-629037499 is affected by this problem. I run into it while ejecting a fairly new expo app. Updating to latest expo, expo-cli and expo-updates did not fix the issue.

It looks like it is related to https://github.com/expo/expo/pull/8324. That PR rely on @react-native-community/cli which is not listed as a dependency on freshly ejected project.

On clean project npm run ios results with:

Error: Cannot find module '@react-native-community/cli/build/commands/bundle/filterPlatformAssetScales'
Require stack:
- /Users/chrmod/Projects/game/node_modules/expo-updates/scripts/createManifest.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
    at Function.Module._load (internal/modules/cjs/loader.js:862:27)
    at Module.require (internal/modules/cjs/loader.js:1042:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/Users/chrmod/Projects/game/node_modules/expo-updates/scripts/createManifest.js:1:35)
    at Module._compile (internal/modules/cjs/loader.js:1156:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/chrmod/Projects/game/node_modules/expo-updates/scripts/createManifest.js'
  ]
}

Installing @react-native-community/cli removes import problem but make it complain about:

The hashAssetFiles Metro plugin is not configured. You need to add a metro.config.js to your project that configures Metro to use this plugin

All problems go away after running pod install

I notice that after eject my project, the same error occurs after starting using “expo-updates”: “~0.2.0”. It was working with “expo-updates”: “~0.1.0”,