Upgrading Expo version from 21 to 24 completely breaks the whole package dependency

I’m getting this error after upgrading Expo from version 21 to 24.

It seems like I have a problem with PropTypes.

From Expo v22.0.0, the author warned that

If you, or any libraries that you use. use View.propTypes.style you
will need to change that to ViewPropTypes.style. You will only see
errors for this in production — so be sure to test your app with
development mode disabled.

But I haven’t used PropTypes in my react native code BUT I guess there is a function in SnackBar has PropTypes and I have to update them to use it.

How can I solve this? The error is saying there is something wrong with Snackbar.js code but I don’t understand…

undefined is not an object (evaluating 'require(37     ).PropTypes.shape') <unknown>
    type.js:1:126 loadModuleImplementation
    require.js:191:12 guardedLoadModule
    require.js:138:36
_require
    require.js:118:20 <unknown>
    SnackBar.js:8:1003 loadModuleImplementation <<<<
    require.js:191:12 guardedLoadModule
    require.js:138:36
_require
    require.js:118:20 <unknown>
    SnackBarManager.js:5:22 loadModuleImplementation
    require.js:191:12 guardedLoadModule
    require.js:138:36
_require
    require.js:118:20 <unknown>
    index.js:1:86 loadModuleImplementation
    require.js:191:12 guardedLoadModule
    require.js:138:36
...

I confirmed that snackbar.js doesn’t have PropTypes.

SnackBar is open source : react-native-snackbar-dialog

This happens to other packages too. I found that moments and time-ago have problem with expo upgrade too. The upgrade break the whole dependency and I can’t figure out what I’'ve done wrong Please help!!!

I really want to keep version 24 because I liked the new feature Splash Screen.

Hey

I updated from SDK 21 to SDK 24, so it’s definitely possible. You will need to grab the latest packages of things like time-ago and moment. ( I can’t recall having to update moment, but definetely time-ago )

The other big change for me was my use of Image as a backgound image container. I had to change it to ImageBackground

Also watch out for Facebook login - that’s change a little too.

1 Like

cd node_modules/react-native-snackbar-dialog && yarn build solved my issue.

Same for other thing packages.

What about Facebook login? I could login but was its syntax changed? I didn’t notice it on Expo upgrade page.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.