0

I have this error after I installed shoutem ui to my project and imported to my ui. "bundling failed: Error: Unable to resolve module `react-native/Libraries/StyleSheet/ColorPropType.js"

I've tried to follow the suggestion from the react-native error page

  1. Clear watchman watches: watchman watch-del-all.
    1. Delete the node_modules folder: rm -rf node_modules && npm install.
    2. Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-* or npm start -- --reset-cache.
    3. Remove haste cache: rm -rf /tmp/haste-map-react-native-packager-*.
Li Xing
  • 111
  • 3
  • 12

1 Answers1

1

Some things broke with versions >= 0.58.x. use below process or using react-native <0.58

create a script file fix.sh

cp ./node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedViewStylePropTypes.js ./node_modules/react-native/Libraries/Components/View/ViewStylePropTypes.js
cp ./node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedColorPropType.js ./node_modules/react-native/Libraries/StyleSheet/ColorPropType.js
cp ./node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedImageStylePropTypes.js ./node_modules/react-native/Libraries/Image/ImageStylePropTypes.js

and in package.json

  {
"scripts": {
"postinstall": "sh ./fix.sh"
 },
  "dependencies": {
    "@shoutem/ui": "^0.23.12",
    "react": "16.6.3",
    "react-native": "0.58.5"
  }
 }
Aurangzaib Rana
  • 4,028
  • 1
  • 14
  • 23