expo: Error in Expo.fx.js on iOS after upgrading to SDK 36

๐Ÿ› Bug Report

Environment

Expo CLI 3.11.2 environment info: System: OS: macOS 10.15.1 Shell: 3.2.57 - /bin/bash Binaries: Node: 12.13.1 - /usr/local/bin/node npm: 6.13.1 - ~/.npm-global/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman IDEs: Xcode: 11.3/11C29 - /usr/bin/xcodebuild npmPackages: expo: ^36.0.0 => 36.0.1 react: 16.9.0 => 16.9.0 react-native: https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz => 0.61.4 react-navigation: ^2.18.2 => 2.18.3 npmGlobalPackages: expo-cli: 3.11.2

Steps to Reproduce

  1. Upgrade to SDK 36 as per the docs

  2. Clean all caches and reinstall: watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && rm -f package-lock.json && rm -f yarn.lock && npm cache verify && npm install && expo r -c

  3. Launch expo: expo start

Expected Behavior

I expect no crash, just like before the upgrade

Actual Behavior

The iPhone screen reads:

Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of `PatchedProviderComponent`.

This error is located at:
    in DevAppContainer (at Expo.fx.js:25)
    in PatchedProviderComponent (at AppContainer.js:115)
    in RCTView (at AppContainer.js:119)
    in AppContainer (at renderApplication.js:39)

The console reads:

React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s%s, undefined,  You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check your code at Expo.fx.js:26., 
    in PatchedProviderComponent (at AppContainer.js:115)
    in RCTView (at AppContainer.js:119)
    in AppContainer (at renderApplication.js:39)
- node_modules/expo/build/environment/muteWarnings.fx.js:27:24 in error
- node_modules/react/cjs/react.development.js:172:36 in warningWithoutStack
- node_modules/react/cjs/react.development.js:612:32 in warning
- node_modules/react/cjs/react.development.js:1944:14 in createElementWithValidation
- node_modules/expo/build/Expo.fx.js:26:13 in PatchedProviderComponent

Both logs state the error is located in node_modules/expo/build/Expo.fx.js

Reproducible Demo

I could not reproduce it by creating a new project, so it is somehow related to this projectโ€™s code

BUT, the same exact code worked just before the upgrade, so anyway, the upgrade breaking the build is an issue.

  1. If itโ€™s ONLY because of my code, the stack trace should indicate what code (it currently states that the bug is in Expo.fx.js)

  2. If itโ€™s somehow related to Expo.fx.js, then there is something to be fixed on Expo side

Thanks

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

@brentvatne it works! thanks for spending so much time helping me. npm install expo@36.0.2 + cache clearing was the solution Thanks

try your steps from the initial comment to be safe:

watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && rm -f package-lock.json && rm -f yarn.lock && npm cache verify && npm install && expo r -c

Same here, upgrade to expo 36.0.2 and clear cache worked for me!