Description
- Updating latest watchman and node.
- Installing lastest react-native-cli
- Initialising react-native project
- Using react-native run-ios without any changes
- Error
transformed 349/394 (89%)
(node:25247) UnhandledPromiseRejectionWarning: Unhandled promise rejection
(rejection id: 893): UnableToResolveError:Unable to resolve module ./assets/back-icon.png from weekdays/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderBackButton.js: Directory weekdays/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/assets/back-icon.png doesn't exist
- Node: v7.2.0
- react-native-cli: v4.1.1
- OSX: ElCapitan: v10.11.5 (15F34)
- Simulator: iPhone 6 - iOS 10.2 (14C89)
- Xcode: v8.2.1 (8C1002)
Opening
/node_modules/react-native/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderBackButton.js
and changing
43: <Image style={styles.button} source={require('./assets/back-icon.png')} />
to
43: <Image style={styles.button} />
resolves issue, but i'm pretty sure i should not do that
Reinstalling node_modules inside project directiory, and inside /node_modules/react-native with
npm cache clean
rm -rf node_modules
npm install
doesn't do the trick.
also chaning package.json dependencies react-native from "0.40.0" to "0.38.0" fixes the problem
How to fix?