Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When calling to file.readAsDataURL (or any other read) WITHOUT livereload the promise never resolves. #2117

Closed
yosigolan opened this issue Nov 14, 2017 · 18 comments

Comments

@yosigolan
Copy link

I'm submitting a ... (check one with "x")
[x ] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/

Current behavior:
When calling to file.readAsDataURL (or any other read) the promise never resolves. it happens only when running WITHOUT live reload. it happens when loading few images to the storage (to the applicationData directory) and then trying to load them and display them.

Expected behavior:
the promise should resolve or reject.

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):
ionic

cli packages: (C:\Users\SeeVoov-Developer\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.18.0
    ionic (Ionic CLI) : 3.18.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.0
    Cordova Platforms  : none
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v8.6.0
    npm  : 5.5.1
    OS   : Windows 10

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

@paulsouche
Copy link

paulsouche commented Nov 14, 2017

Hi,

Same issue here !

I've noticed the problem is that this is never called back when cordova FileReader is patched by zone.js

Sometimes (I can't find a way to reproduce each time) File plugin script is loaded before zone.js patch and it breaks something.

My workaround was to move cordova.js script after zone one and it seems to be working...

Hope it helps

Thanks anyway for the great job

EDIT

seems to be same problem as #1174 and ionic-team/ionic-native#505 discussion is open here ionic-team/ionic2-app-base#126

So maybe it can be closed and we'll continue on it

@yosigolan
Copy link
Author

Thank you @paulsouche ! i moved the cordova.js after vendor.js script (in the index.html) and it did solved it.
thank you very much!

@vzharkov
Copy link

I have the same problem when i use ReadAsText method from FileReader. onloadend event does not fired. Issue starts from update ionic up to 3.9.2 version.
Fix from @paulsouche works, but it is not a right way to solve this issue.

@paulsouche
Copy link

Hi @vzharkov ,

I think we should find a solution between cordova / Zone / file-plugin on this thread

@yosigolan
Copy link
Author

@danielsogl why do you close this? is it fixed?

@franbueno
Copy link

We are on May and it works randomly. So it wasn't fixed. Thanks @paulsouche for your workaround.

@pistou
Copy link

pistou commented May 24, 2018

Yep, definitly not fixed.

@lordgreg
Copy link

should be reopen.

@CarlosAyala
Copy link

Hi,
I had the same issue, i fixed it moving the cordova.js after vendor.js,
Thx!

@CarlosAyala
Copy link

@danielsogl
Hi, this needs to be reopen. Not fixed.

@CarlosAyala
Copy link

Update cordova-android to version 7.1.1 and zone.js to 0.8.26 to fix this issue in Ionic3.

@charles-dr
Copy link

Thanks , @paulsouche and @CarlosAyala
It works like a charm!
Moved the cordova.js after the vendor.js in index.html file

@willyguevara
Copy link

Thank you @paulsouche ! i moved the cordova.js after vendor.js script (in the index.html) and it did solved it for me too.

@kispi
Copy link

kispi commented Oct 22, 2019

You don't need to suffer if you just don't use Ionic or you will suffer from bunch of nightmares forever

@roiko
Copy link

roiko commented Dec 1, 2019

Thank you @paulsouche , you saved me from an afternoon of pain!

@shanmukss66
Copy link

Thank you @paulsouche ! i moved the cordova.js after vendor.js script (in the index.html) and it did solved it.
thank you very much!

Hi,

Same issue here !

I've noticed the problem is that this is never called back when cordova FileReader is patched by zone.js

Sometimes (I can't find a way to reproduce each time) File plugin script is loaded before zone.js patch and it breaks something.

My workaround was to move cordova.js script after zone one and it seems to be working...

Hope it helps

Thanks anyway for the great job

EDIT

seems to be same problem as #1174 and ionic-team/ionic-native#505 discussion is open here ionic-team/ionic2-app-base#126

So maybe it can be closed and we'll continue on it

im using ionic ver 5 here there is no cordova.js or vendor.js what should i do? please help me

@julian-bruening-wiadok
Copy link

This seems to still be an issue. Is there a workaround?
Filesytem from Capacitor is working, but I dont know how to use it with the Video Capture Plus Plugin.

@igormieski27
Copy link

Thank you @paulsouche ! i moved the cordova.js after vendor.js script (in the index.html) and it did solved it.
thank you very much!

Hi,
Same issue here !
I've noticed the problem is that this is never called back when cordova FileReader is patched by zone.js
Sometimes (I can't find a way to reproduce each time) File plugin script is loaded before zone.js patch and it breaks something.
My workaround was to move cordova.js script after zone one and it seems to be working...
Hope it helps
Thanks anyway for the great job
EDIT
seems to be same problem as #1174 and ionic-team/ionic-native#505 discussion is open here ionic-team/ionic2-app-base#126
So maybe it can be closed and we'll continue on it

im using ionic ver 5 here there is no cordova.js or vendor.js what should i do? please help me

I'm going through the same problem, do you happen to find a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests