5

When using RNFetchBlob with React Native I get a yellow warning screen that says:

Module RNFetchBlob requires main queue setup since it overrides constantsToExport but doesn't implement requiresMainQueueSetup. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.

I am using react-native 0.56.0 and react-native-fetch-blob: 0.10.8. This worked previously with react-native 0.54.2.

What exactly is this error telling me? What exactly is main queue setup? What should I do to fix this problem? Thanks!

kojow7
  • 10,308
  • 17
  • 80
  • 135

2 Answers2

39

It turns out that react-native-fetch-blob is no longer supported and I needed to use rn-fetch-blob instead. To fix this I had to do the following:

  1. react-native unlink react-native-fetch-blob
  2. npm uninstall --save react-native-fetch-blob
  3. npm install --save rn-fetch-blob
  4. react-native link

I then had to change all lines that used:

import RNFetchBlob from 'react-native-fetch-blob';

to:

import RNFetchBlob from 'rn-fetch-blob';

Everything is now working the way that it should.

kojow7
  • 10,308
  • 17
  • 80
  • 135
2

If you are using react native 0.63.3, after replacing react-native-fetch-blob with rn-fetch-blob there is no link command, so don't forget to execute pod install in ios directory.

Kasra
  • 1,959
  • 1
  • 19
  • 29