6

error: bundling failed: Error: Unable to resolve module hoist-non-react-statics from E:\DEVELOPMENTWORKSPACE\test\node_modules\react-native-calendars\src\expandableCalendar\asCalendarConsumer.js: Module hoist-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:

  1. Clear watchman watches: watchman watch-del-all.
  2. Delete the node_modules folder: rm -rf node_modules && npm install.
  3. Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-* or npm start -- --reset-cache.
  4. Remove haste cache: rm -rf /tmp/haste-map-react-native-packager-*.
Tasos K.
  • 7,979
  • 7
  • 39
  • 63

1 Answers1

3

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!

Emanuele Sacco
  • 411
  • 5
  • 20