cordova-plugin-code-push
                                
                                 cordova-plugin-code-push copied to clipboard
                                
                                    cordova-plugin-code-push copied to clipboard
                            
                            
                            
                        Message: TypeError: null is not an object (evaluating 'result.lengthComputable')
code-push generated this error on update:
Message: TypeError: null is not an object (evaluating 'result.lengthComputable') - URL: file:///var/mobile/Containers/Data/Application/4706A9CC-AD0B-40AF-A513-F3CEAED70319/Library/NoCloud/codepush/deploy/versions/23c4ff2c63e95c6bd84f69a937ad7ee19e364d0ad091b96aa6827bdff6c0b4e5/www/cordova.js - Line: 314 - Column: 22 - Error object: {\"line\":202,\"column\":26,\"sourceURL\":\"file:///var/mobile/Containers/Data/Application/4706A9CC-AD0B-40AF-A513-F3CEAED70319/Library/NoCloud/codepush/deploy/versions/23c4ff2c63e95c6bd84f69a937ad7ee19e364d0ad091b96aa6827bdff6c0b4e5/www/plugins/cordova-plugin-file-transfer/www/FileTransfer.js\"}"
This is the first time i've seen this issue and i was able to still successfully update my app.
Hello @aaronorosen thank you for filling the issue. Would you have a chance to answer several questions below?
- Is it the only time you see this exception? Are you able to reproduce it multiple times?
- Is it on device or on simulator, iOS or Android?
- Is it possible that you have exact reproduction steps or may be a minimum sample app so we can replicate the issue too?
- Do you have any special aspects about your app or in the updated content?
I've only seen this error once. On ios device
@aaronorosen got it, that looks very uncommon. Seems that this is transient error and we haven't seen this before/reported by anyone earlier. I believe this error may relates to logic in Cordova FileTransfer.js but changes to it should not be handled under code-push repository. So I think we couldn't address this properly until we have stable repro steps or some more info. Do you mind if we close the issue for now and we will reopen it if you see this more times or in case of other questions?
Thanks for looking into this
I just saw this running on an iPad 2 running iOS 9.3.5 running all latest npm packages. I also tested on iOS 12 devices, and did not get the error (yet).
I'm seeing this now on iOS 12 as well. I just added CodePush to my app. It seems that the error rate on iOS is perhaps about 1% of active devices per day. Before switching to CodePush, I was using a homegrown OTA system that also used cordova file transfer with the same download method call. But I never got this error using the old system; only with CodePush.
Here is a stack trace:
TypeError · null is not an object (evaluating 'result.lengthComputable')
file:///var/mobile/Containers/Data/Application/7BA61D6E-C68F-4552-A61C-9AA588DA483F/Library/NoCloud/codepush/deploy/versions/6600d12132dcbddee1d809de4886eab3e5e4ede1fa61c587d183e61023bc87f9/www/plugins/cordova-plugin-file-transfer/www/FileTransfer.js:202:26 - win	
file:///var/mobile/Containers/Data/Application/7BA61D6E-C68F-4552-A61C-9AA588DA483F/Library/NoCloud/codepush/deploy/versions/6600d12132dcbddee1d809de4886eab3e5e4ede1fa61c587d183e61023bc87f9/www/cordova.js:291:63 - callbackFromNative	
file:///var/mobile/Containers/Data/Application/7BA61D6E-C68F-4552-A61C-9AA588DA483F/Library/NoCloud/codepush/deploy/versions/6600d12132dcbddee1d809de4886eab3e5e4ede1fa61c587d183e61023bc87f9/www/cordova.js:1042:39 - nc2
It also looks like this error can occur quite frequently if using WkWebView (I'm using UIWebView): https://issues.apache.org/jira/browse/CB-13434?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel
And cordova-plugin-file-transfer is now deprecated, with the recommendation to transition to using newer standards-compliant platform features: https://cordova.apache.org/blog/2017/10/18/from-filetransfer-to-xhr2.html
Is cordova-plugin-code-push project willing to require a minimum iOS 10? That's what the next version of cordova-ios platform will require in any event: https://github.com/apache/cordova-ios/commit/d1acc925b7ca8a3214f7adee6675567b5bf51dc1#commitcomment-31732324
I also just saw that Apple has announced:
Starting March 2019, all iOS apps submitted to the App Store will need to be built with the iOS 12.1 SDK or later, and support the all-screen design of iPhone XS Max or the 12.9-inch iPad Pro (3rd generation). Source: https://developer.apple.com/ios/submit/
So at that point, there's really no point in using cordova-plugin-file-transfer anymore, and it should be replaced with a standard-compliant implementation.
@annakocheshkova Thanks for reopening.
I'm seeing this error come up a lot on all versions of IOS 9-12.
The same issue was created in Apacha Cordova a couple years ago, and they closed it as Won't Fix, saying the plugin is deprecated, and developers should instead use the new features of XMLHttpRequest: https://issues.apache.org/jira/browse/CB-13434?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel
I opened issue #485 to replace CodePush use of the file-transfer plugin to a standards-compliant implementation.