Error when ejecting from SDK 39 (No issues with v38)

Preface: This same project was able to successfully eject and build from SDK 38

Ejecting the project from SDK 39 was successful, but running react-native run-ios results in the following error:

Failed to construct transformer:  TypeError: Transformer is not a constructor
    at getTransformCacheKey (/Users/nxc/w/app/node_modules/metro/src/DeltaBundler/Transformer/getTransformCacheKey.js:33:31)
    at new Transformer (/Users/nxc/w/app/node_modules/metro/src/DeltaBundler/Transformer.js:147:28)
    at /Users/nxc/w/app/node_modules/metro/src/Bundler.js:54:29
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Error loading assets JSON from Metro. Ensure you've followed all expo-updates installation steps correctly. Cannot read property 'transformFile' of undefined
    at /Users/nxc/w/app/node_modules/expo-updates/scripts/createManifest.js:27:11
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Command PhaseScriptExecution failed with a nonzero exit code

Steps Taken

  1. Delete and re-install node_modules
  2. Run pod install in the ios directory

Expo Diagnostics

Expo CLI 3.27.11 environment info:
      OS: macOS 10.15.6
      Shell: 5.7.1 - /bin/zsh
      Node: 14.12.0 - ~/n/bin/node
      Yarn: 1.22.10 - ~/n/bin/yarn
      npm: 6.14.8 - ~/n/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
      CocoaPods: 1.9.3 - /usr/local/bin/pod
      iOS SDK:
        Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
      Android Studio: 4.0 AI-193.6911.18.40.6626763
      Xcode: 12.0/12A7209 - /usr/bin/xcodebuild
      expo: ^39.0.0 => 39.0.3
      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.7 => 0.13.14
      expo-cli: 3.27.11
    Expo Workflow: bare```

Hey @archcorsair,

Can you let me know if you are able to reproduce this with a newly created project? Would be useful to know if the issue is more widespread or something particular with your current project.


Hi @adamjnav,

Thanks for getting back so quickly. I have just resolved the issue by clearing the metro cache yarn start --reset-cache and running pod install --repo-update. This combination fixed it for me.

1 Like

For me the error was due to version mismatch of metro and react native. For React Native > 0.60 metro version 0.58 is supported but it was upgraded to 0.61 which caused this error. You can change the version in package.json and run yarn install again.

1 Like

Bingo! Same here, I needed to downgrade metro to 0.58. Thank you! :pray: