Reputation: 124
error: bundling failed: Error: Unable to resolve module
hoist-non-react-statics
fromE:\DEVELOPMENTWORKSPACE\test\node_modules\react-native-calendars\src\expandableCalendar\asCalendarConsumer.js
: Modulehoist-non-react-statics
does not exist in the Haste module map
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
watchman watch-del-all
.node_modules
folder: rm -rf node_modules && npm install
.rm -rf /tmp/metro-bundler-cache-*
or npm start -- --reset-cache
.rm -rf /tmp/haste-map-react-native-packager-*
.Upvotes: 6
Views: 2971
Reputation: 431
The problem is that src/expandableCalendar/asCalendarConsumer.js is trying to import 'hoist-non-react-statics' which is not declared as a dependency in package.json So the solution is to add it in package.json as this:
"dependencies": {
"lodash": "^4.0.0",
"prop-types": "^15.5.10",
"xdate": "^0.8.0",
"hoist-non-react-statics": "*"},
than run npm install
run react-native run-ios
and you're up to go!
Upvotes: 3