Ionic-framework: file reader plugin events are not firing

Created on 27 Aug 2016  路  5Comments  路  Source: ionic-team/ionic-framework

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

Most helpful comment

@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!

All 5 comments

This issue was moved to driftyco/ionic-native#505

Hello! Thanks for opening an issue with us! Since this was an issue with Ionic Native and not the Ionic framework I have moved this issue to that repo. Thanks for using Ionic!

I agree , Its not fixed .

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

onloaded never gets fired

@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!

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brandyscarney picture brandyscarney  路  3Comments

gio82 picture gio82  路  3Comments

alan-agius4 picture alan-agius4  路  3Comments

MrBokeh picture MrBokeh  路  3Comments

Nick-The-Uncharted picture Nick-The-Uncharted  路  3Comments