Details
-
Bug
-
Status: Open
-
Critical
-
Resolution: Unresolved
-
6.0.1
-
None
-
cordova version: 7.1.0
cordova-android: 7.1.0
cordova-ios: 7.1.0
Description
When reading a large json file (293kb), readAsText renders string incorrectly, adding duplicate text after the file's text ends and breaking json structure. JSON.parse the text fails due to this. It hangs and fails.
const root = `${this.window.cordova.file.applicationDirectory}www/assets/`; this.window.resolveLocalFileSystemURL(this.root + fileName, (fileEntry: FileEntry) => { fileEntry.file(file => { const reader = new (<any>this.window.cordova).FileReader(); reader.onloadend = function () { console.log(JSON.parse(this.result)); }; reader.readAsText(file); }); });