1

I have a simple react app which I generated from react native cli, when I add native-base import to my component and run the app by react-native run-ios I get the following error:

Failed to load bundle(http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false) with error:(Unable to resolve module react-timer-mixin from /Users/wallet/Desktop/Projects/HomaWallet/node_modules/native-base/dist/src/basic/Tabs/index.js: Module react-timer-mixin 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-*. (null))

__38-[RCTCxxBridge loadSource:onProgress:]_block_invoke.226 RCTCxxBridge.mm:412

___ZL36attemptAsynchronousLoadOfBundleAtURLP5NSURLU13block_pointerFvP18RCTLoadingProgressEU13block_pointerFvP7NSErrorP9RCTSourceE_block_invoke.118

__80-[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:]_block_invoke

-[RCTMultipartStreamReader emitChunk:headers:callback:done:]

-[RCTMultipartStreamReader readAllPartsWithCompletionCallback:progressCallback:]

-[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:]

__88-[NSURLSession delegate_streamTask:didBecomeInputStream:outputStream:completionHandler:]_block_invoke

-[NSBlockOperation main] -[__NSOperationInternal _start:] __NSOQSchedule_f _dispatch_call_block_and_release _dispatch_client_callout _dispatch_continuation_pop _dispatch_async_redirect_invoke _dispatch_root_queue_drain _dispatch_worker_thread2 _pthread_wqthread start_wqthread

React native version 0.58.1

Native Base version ^2.10.0

OS Mac

3
  • Did you tried restarting the bundler?...because it says that unable to resolve the module , This usually happens when we add a new library and run the app without restarting the bundler. Commented Jan 28, 2019 at 9:50
  • As @AkshayAggarwal says, most issues like this are caused by the bundler needing to be restarted this gist shows a tried and tested way to clear the cache gist.github.com/jarretmoses/c2e4786fd342b3444f3bc6beff32098d Commented Jan 28, 2019 at 9:55
  • didn't you try "npm i --save react-timer-mixin"? Commented Jan 30, 2019 at 13:48

3 Answers 3

3

Upgrade your native-base version to be at least 2.11.0, this is the version that the issue was fixed. You can find more details in their github under 2.11.0 release: https://github.com/GeekyAnts/NativeBase/releases

Sign up to request clarification or add additional context in comments.

Comments

2

Just add "react-timer-mixin": "0.13.4" to your package.json and install. This helped me for the same issue with react-native: 0.58.6 and native-base 2.8.1

Comments

0

I fix it by downgrading react native version to 57.7 and native base version to 2.8.1

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.