question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

file reader plugin events are not firing

See original GitHub issue

Short description of the problem:

while using file plugin with ionic-native found out that readAsArrayBuffer(path, file) promise never resolves! i did some digging and turns out it’s an fixed angular 2 zone issue and here is a detailed closed ionic issue about it. https://github.com/driftyco/ionic/issues/6020 it looks like it’s never been fixed for ionic 2

What behavior are you expecting?

file promises to be resolved

Steps to reproduce:

  1. setup a new project
  2. install camera and file plugin
  3. getpicture with camera and try to read it with readAsArrayBuffer
Camera.getPicture(options).then((imageData) => {
File.readAsArrayBuffer(imageData).then((res)=>{
//never resolves.
});
});

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc) https://github.com/angular/zone.js/issues/137 https://github.com/angular/angular/issues/2533

Which Ionic Version? 1.x or 2.x Cordova CLI: 6.0.0 Ionic Framework Version: 2.0.0-beta.11 Ionic CLI Version: 2.0.0-beta.36 Ionic App Lib Version: 2.0.0-beta.19 OS: Windows 8.1 Node Version: v4.4.3

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
pdrososcommented, Jan 18, 2017

@jgw96 it seems a fix is found for this one in https://github.com/driftyco/ionic-native/issues/505#issuecomment-273504996 cordova.js must be loaded after polyfills.js in index.html

It will be best if this can be done in the Ionic starter projects, so it doesn’t happen to other users, as it’s very hard to debug and identify.

Thanks!

2reactions
saurabhvyascommented, Sep 3, 2016

I agree , Its not fixed .

var reader = new FileReader(); reader.onloadend = (evt: any) => { }

onloaded never gets fired

Read more comments on GitHub >

github_iconTop Results From Across the Web

file reader plugin events are not firing · Issue #505 - GitHub
I was able to fix my issue by getting the original native browser instance and using it. let fileReader = new FileReader(); //...
Read more >
FileReader events not firing in iOS - Ionic Forum
So I am looking to upload video files on ios. I read in a file using the fileEntry.file(*) method that results in a...
Read more >
filePluginIsReady event is never fired in chrome when using ...
Chrome filesystem is not immediately ready after device ready event. As a workaround you can subscribe to filePluginIsReady event....You can use window.
Read more >
The Events Calendar event links not working | WordPress.org
[This thread is closed.] This problem probably started around 1-2 weeks ago (10/12/2020). When I click on an event such as https://imana.…
Read more >
Plugin MouseButton1Click Event is not firing, just why?
What do you want to achieve? Keep it simple and clear! I want to make a plugin that allows me to import mesh...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found