Open SusulAdam opened 2 years ago
@SusulAdam create file rn-fetch-blob.js
from root project.
// rn-fetch-blob.js
const fs = require('fs');
const replaced = "import RNFetchBlob from '../index.js'";
const replacement =
"import {NativeModules} from 'react-native';\nconst RNFetchBlob = NativeModules.RNFetchBlob";
const files = [
'node_modules/rn-fetch-blob/polyfill/Fetch.js',
'node_modules/rn-fetch-blob/polyfill/Blob.js',
'node_modules/rn-fetch-blob/polyfill/XMLHttpRequest.js',
];
files.forEach(file => {
fs.readFile(file, 'utf8', function (readErr, data) {
if (readErr) {
return null;
}
const result = data.replace(new RegExp(replaced, 'g'), replacement);
fs.writeFile(file, result, 'utf8', function (err) {
if (err) {
return null;
}
});
});
});
Run node rn-fetch-blob.js
Is there a permanent solution to this? I don't have my node_modules included on the project repository.
@SusulAdam create file
rn-fetch-blob.js
from root project.// rn-fetch-blob.js const fs = require('fs'); const replaced = "import RNFetchBlob from '../index.js'"; const replacement = "import {NativeModules} from 'react-native';\nconst RNFetchBlob = NativeModules.RNFetchBlob"; const files = [ 'node_modules/rn-fetch-blob/polyfill/Fetch.js', 'node_modules/rn-fetch-blob/polyfill/Blob.js', 'node_modules/rn-fetch-blob/polyfill/XMLHttpRequest.js', ]; files.forEach(file => { fs.readFile(file, 'utf8', function (readErr, data) { if (readErr) { return null; } const result = data.replace(new RegExp(replaced, 'g'), replacement); fs.writeFile(file, result, 'utf8', function (err) { if (err) { return null; } }); }); });
Run
node rn-fetch-blob.js
Probably it is easier to use patch-package, But is there any reason to not include it this way in this repo?
Same issue as https://github.com/joltup/rn-fetch-blob/issues/183 Something got merged 15 days ago https://github.com/joltup/rn-fetch-blob/pull/688.
Is there going to be a new release with those fixes ? :smile:
"rn-fetch-blob": "0.12.0" "react-native": "0.63.3"
I am struggle with three warning Require cycle: