Code Monkey home page Code Monkey logo

Comments (20)

Mohamed-Sheik-Ali avatar Mohamed-Sheik-Ali commented on July 24, 2024 37

Hi @mMarcos208 I think the issue is with package version, I also stumbled on the same error. So, I downgraded the version to [email protected] it works for me. Hope it helps.

from react-native-blob-util.

appa-gomi avatar appa-gomi commented on July 24, 2024 5

Comment the two line(273, 274) in fetch.js

                         fs.session(options.session).add(data);
                 }
                 respInfo.rnfbEncode = rawType;
-                if ('uninit' in respInfo && respInfo.uninit) // event didn't fire yet so we override it here
-                    respInfo = responseInfo;
+                // if ('uninit' in respInfo && respInfo.uninit) // event didn't fire yet so we override it here
+                //     respInfo = responseInfo;
                 resolve(new FetchBlobResponse(taskId, respInfo, data));
             }

from react-native-blob-util.

MohamedMegdich1 avatar MohamedMegdich1 commented on July 24, 2024 3

Hi @mMarcos208, I have fixed this issue by wrapping the path with path: ReactNativeBlobUtil.wrap(filePath)

`
import {Platform} from 'react-native'
import ReactNativeBlobUtil, {ReactNativeBlobUtilConfig} from 'react-native-blob-util'

export const options = (name: string, extension = 'pdf', notification = true) => {
const {fs} = ReactNativeBlobUtil
const {
dirs: {DocumentDir, DownloadDir},
} = fs
return Platform.select({
ios: {
fileCache: true,
path: ReactNativeBlobUtil.wrap(${DocumentDir}/${name}),
title: name,
},
android: {
fileCache: true,
addAndroidDownloads: {
useDownloadManager: true,
notification,
title: name,
path: ReactNativeBlobUtil.wrap( ${DownloadDir}/${name}.${extension}),
},
},
}) as ReactNativeBlobUtilConfig
}
`

from react-native-blob-util.

obinote avatar obinote commented on July 24, 2024 1
diff --git a/node_modules/react-native-blob-util/fetch.js b/node_modules/react-native-blob-util/fetch.js
index ed4e67f..fe541e5 100644
--- a/node_modules/react-native-blob-util/fetch.js
+++ b/node_modules/react-native-blob-util/fetch.js
@@ -270,8 +270,8 @@ export function fetch(...args: any): Promise {
                         fs.session(options.session).add(data);
                 }
                 respInfo.rnfbEncode = rawType;
-                if ('uninit' in respInfo && respInfo.uninit) // event didn't fire yet so we override it here
-                    respInfo = responseInfo;
+                // if ('uninit' in respInfo && respInfo.uninit) // event didn't fire yet so we override it here
+                //     respInfo = responseInfo;
                 resolve(new FetchBlobResponse(taskId, respInfo, data));
             }
 

It work for me.

from react-native-blob-util.

mMarcos208 avatar mMarcos208 commented on July 24, 2024 1

Downgrade to 0.19.4 cause this error #204

from react-native-blob-util.

RemiHin avatar RemiHin commented on July 24, 2024

Hi @mMarcos208 I think the issue is with package version, I also stumbled on the same error. So, I downgraded the version to [email protected] it works for me. Hope it helps.

I have the same issue, reverting back to 0.19.4 solved it for now

from react-native-blob-util.

zehratok avatar zehratok commented on July 24, 2024

Comment the two line(273, 274) in fetch.js

                         fs.session(options.session).add(data);
                 }
                 respInfo.rnfbEncode = rawType;
-                if ('uninit' in respInfo && respInfo.uninit) // event didn't fire yet so we override it here
-                    respInfo = responseInfo;
+                // if ('uninit' in respInfo && respInfo.uninit) // event didn't fire yet so we override it here
+                //     respInfo = responseInfo;
                 resolve(new FetchBlobResponse(taskId, respInfo, data));
             }

This method worked for me, thank you. However, I didn't understand why such a change was made in the package; the commit messages were not explanatory.

from react-native-blob-util.

imanshul avatar imanshul commented on July 24, 2024

Any update? still facing this issue, and downgrading to 0.19.4 also doesn't resolve the issue

from react-native-blob-util.

TheWirv avatar TheWirv commented on July 24, 2024

Comment the two line(273, 274) in fetch.js

                         fs.session(options.session).add(data);
                 }
                 respInfo.rnfbEncode = rawType;
-                if ('uninit' in respInfo && respInfo.uninit) // event didn't fire yet so we override it here
-                    respInfo = responseInfo;
+                // if ('uninit' in respInfo && respInfo.uninit) // event didn't fire yet so we override it here
+                //     respInfo = responseInfo;
                 resolve(new FetchBlobResponse(taskId, respInfo, data));
             }

This patch also fixed the issue for me, thanks!

from react-native-blob-util.

Sakib-203-15-3883 avatar Sakib-203-15-3883 commented on July 24, 2024

Hi @mMarcos208 I think the issue is with package version, I also stumbled on the same error. So, I downgraded the version to [email protected] it works for me. Hope it helps.

It works for me.

from react-native-blob-util.

RonRadtke avatar RonRadtke commented on July 24, 2024

Can you tell me in which line this fails exactly?
Does it happen on Android or iOS or both?
Would like to fix this.

But to explain the changes.
There are cases where the native events are triggered after the callback is triggered. Therefor the callback gets all information and if the event happens to arrive after the callback we still can resolve with all required information.

Just that seems like I missed something

from react-native-blob-util.

maksimko avatar maksimko commented on July 24, 2024

In my case it only happens on Android. The same code on iOS works fine.
Version 0.19.4 works well on both platforms.

from react-native-blob-util.

raymondjacobson avatar raymondjacobson commented on July 24, 2024

+1 seeing this issue. 0.19.4 fixes it for me as well.

from react-native-blob-util.

endrits079 avatar endrits079 commented on July 24, 2024

Hi @mMarcos208, I have fixed this issue by wrapping the path with path: ReactNativeBlobUtil.wrap(filePath)

` import {Platform} from 'react-native' import ReactNativeBlobUtil, {ReactNativeBlobUtilConfig} from 'react-native-blob-util'

export const options = (name: string, extension = 'pdf', notification = true) => { const {fs} = ReactNativeBlobUtil const { dirs: {DocumentDir, DownloadDir}, } = fs return Platform.select({ ios: { fileCache: true, path: ReactNativeBlobUtil.wrap(${DocumentDir}/${name}), title: name, }, android: { fileCache: true, addAndroidDownloads: { useDownloadManager: true, notification, title: name, path: ReactNativeBlobUtil.wrap( ${DownloadDir}/${name}.${extension}), }, }, }) as ReactNativeBlobUtilConfig } `

worked for me

from react-native-blob-util.

paskalov-aris avatar paskalov-aris commented on July 24, 2024

Hi @mMarcos208 I think the issue is with package version, I also stumbled on the same error. So, I downgraded the version to [email protected] it works for me. Hope it helps.

Downgrading from 0.19.6 to 0.19.4 fixed the error in my case. Thanks.

from react-native-blob-util.

RonRadtke avatar RonRadtke commented on July 24, 2024

@mMarcos208 @paskalov-aris @endrits079
Anyone can tell we whitch line is causing the probelm?
And is it an on progress event or when the request is finished?
Android / ios / both?

Some more information to reproduce it would be great so you don't have to downgrade

from react-native-blob-util.

bhavdeep-pixer avatar bhavdeep-pixer commented on July 24, 2024

Hi @mMarcos208 I think the issue is with package version, I also stumbled on the same error. So, I downgraded the version to [email protected] it works for me. Hope it helps.

It's also worked for me. Thanks @Mohamed-Sheik-Ali

from react-native-blob-util.

RonRadtke avatar RonRadtke commented on July 24, 2024

@mMarcos208 @paskalov-aris @endrits079 Anyone can tell we whitch line is causing the probelm? And is it an on progress event or when the request is finished? Android / ios / both?

Some more information to reproduce it would be great so you don't have to downgrade

@bhavdeep-pixer same question to you.

from react-native-blob-util.

herberthk avatar herberthk commented on July 24, 2024

Hi @mMarcos208 I think the issue is with package version, I also stumbled on the same error. So, I downgraded the version to [email protected] it works for me. Hope it helps.

Thanks solved my issue

from react-native-blob-util.

sadewole avatar sadewole commented on July 24, 2024

The file got downloaded but cannot locate it in the device file manager. It was downloaded to the internal app which is not visible.

How can this be fixed, please?

from react-native-blob-util.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.