Can't resolve 'react-native-web/dist/exports/ColorPropType'

7.4k Views Asked by At

I had one application and I wanted try expo start:web functionality and it did have error like AsyncStorage after solving that the i have the error

Can't resolve 'react-native-web/dist/exports/ColorPropType'

Simply,

/Users/xxx/Documents/xxxx/node_modules/react-native-maps/lib/components/MapView.js
Module not found: Can't resolve 'react-native-web/dist/exports/ColorPropType' in '/Users/xxx/Documents/xxxx/node_modules/react-native-maps/lib/components'

Can anyone help me please.

1

There are 1 best solutions below

1
On

I finally got it. There are library like react-native-progress, swiper-flatlist which doesnot support for react-native-web. react-native-web work-on-progress so we have neglect those library which won't be supported with web

For that I remove all the library except the initial library i.e. (expo expo-status-bar react react-dom react-native react-native-web)

And then install every thing one by one OR module by module like (all packages of react-navigation, all packages of redux-observable, all packages of redux and so-on)

And after completion of installation one module, expo start:web and again repeating the process till I din't find the error libraries like in may case (react-native-swiper-flatlist & react-native-progress)

Then finally neglecting those library from the package.json for testing purpose only. If possible you will be able use Platform.OS=="web" like Platform specific code too.

Please use https://expo.canny.io/feature-requests/p/swiper-flatlist to request for the feature and check other feature-request too