I’ve noticed for a long time that Hot Code Push works unreliably in our production app. It only works about half of the time. Reproducing on Android, when Hot Code Push fails, it is always with the below error.
Meteor 1.10.2, cordova-plugin-meteor-webapp 1.9.1.
As far as I can tell the error is thrown in AssetBundleDownloader.java and passed on by webapp-local-server.js
What might cause this?
Error: Error downloading asset: /__cordova/packages/templating-compiler.js
at http://localhost:12472/plugins/cordova-plugin-meteor-webapp/www/webapp-local-server.js:51:21
at Object.callbackFromNative (http://localhost:12472/cordova.js:287:58)
at <anonymous>:1:9
The filename behind /__cordova/packages/
varies each time - dynamic-import.js
, es5-shim.js
, things like a8556108306b4c6c9b96fdb067c7f600610471a.map
Edit:
The above logs were from the staging app; in production the errors are slightly different. Instead of Error downloading asset: /__cordova/packages/templating-compiler.js
, I've seen each of the following:
I ended up moving the files from one subfolder in my public
folder to S3, halving the size of public
. It seems this solved it 100%.
I'm guessing cordova-plugin-meteor-webapp
was more or less consistently failing to download the largest file, but for some reason ended up reporting errors on other files.
Edit: this is now mentioned in the official Meteor guide: https://guide.meteor.com/hot-code-push.html