[Solved] Broken Hot Code Push on Cordova (from hiding sourcemaps)

Update: Turns out this was caused by zodern:hide-production-sourcemapssee this GitHub issue. Leaving this post in case it helps others in the future.

My new iOS app is currently in TestFlight. I just deployed an update to the server but the app isn’t updating itself. :slightly_frowning_face:

I had no issues with hot code push in development, and I have no issues with the web version of the app. More importantly, I kept my Meteor release and Cordova plugins the same, so it’s not a cordovaCompatabilityVersion issue. The update was a pretty minor bugfix, in fact.

In comparing the old /__cordova/manifest.json with the new version, nothing seems like it’d be an issue. I’ll paste in an abridged diff below, followed by a cleaner diff of meteorRuntimeConfig.

Can anyone think of a reason HCP would fail to work besides differing Cordova compatibility versions?

Diff of /__cordova/manifest.json
 {
   "format": "web-program-pre1",
   "manifest": [{
-    "path": "4ad92173239ed66872e1aa1bed0690b7a56fcd94.js",
+    "path": "0d77bcd0895e543562974661a729f74ab8fcad99.js",
     "where": "client",
     "type": "js",
     "cacheable": true,
-    "url": "/__cordova/4ad92173239ed66872e1aa1bed0690b7a56fcd94.js?meteor_js_resource=true",
+    "url": "/__cordova/0d77bcd0895e543562974661a729f74ab8fcad99.js?meteor_js_resource=true",
-    "sourceMap": "4ad92173239ed66872e1aa1bed0690b7a56fcd94.js.map",
+    "sourceMap": "0d77bcd0895e543562974661a729f74ab8fcad99.js.map",
-    "sourceMapUrl": "/__cordova/4ad92173239ed66872e1aa1bed0690b7a56fcd94.map",
+    "sourceMapUrl": "/__cordova/0d77bcd0895e543562974661a729f74ab8fcad99.map",
-    "size": 2741780,
+    "size": 2740927,
-    "hash": "4ad92173239ed66872e1aa1bed0690b7a56fcd94",
+    "hash": "0d77bcd0895e543562974661a729f74ab8fcad99",
-    "sri": "EwzE7n5QTKK9oVzamPDVYUH/8zTm1ERWcW13H5J1hOrEQpqlt9qWkvKfcmquuj3NZVaqw6GCLMI5zYguaEee9A=="
+    "sri": "6ShTzmrgmtElWUdPSiTPvtE87KNQZPxhisZaFLPm60Pc/KdW8G22k6DeI8iYTiPYiUSUlxYiQfFRKeaMyplHpA=="
   }, {
-    "path": "4ad92173239ed66872e1aa1bed0690b7a56fcd94.stats.json",
+    "path": "0d77bcd0895e543562974661a729f74ab8fcad99.stats.json",
     "where": "client",
     "type": "json",
     "cacheable": true,
-    "url": "/__cordova/4ad92173239ed66872e1aa1bed0690b7a56fcd94.stats.json?meteor_js_resource=true",
+    "url": "/__cordova/0d77bcd0895e543562974661a729f74ab8fcad99.stats.json?meteor_js_resource=true",
     "size": 58821,
-    "hash": "8a09f3b6a4b91059f311306a5cf6c538a902c525",
+    "hash": "d37990558683d8b0e4292e7063dbc382d1474a55",
-    "sri": "at0yh+qRRI2Kg5D59qKsJphNiYxAtv64n+8Cw4zV2Vg49WOrWVz7dsZu6rVGUkNm76RRul+zSa+EnYL12ZBs/w=="
+    "sri": "7XrGOiYghXy37n0RcDYNwDJRnCPo9rmX5jS6qMqCFhOg+6nCKLGodTuZhT/TngZGch1ErwoTAjYeSePU5TplTQ=="
   }, {
-    "path": "48820e30dc846ddbb0d986595bf8e442378bd27b.css",
+    "path": "9dbfae38a1704d3e71421c1247a1daae50823c5d.css",
     "where": "client",
     "type": "css",
     "cacheable": true,
-    "url": "/__cordova/48820e30dc846ddbb0d986595bf8e442378bd27b.css?meteor_css_resource=true",
+    "url": "/__cordova/9dbfae38a1704d3e71421c1247a1daae50823c5d.css?meteor_css_resource=true",
-    "size": 281074,
+    "size": 281091,
-    "hash": "48820e30dc846ddbb0d986595bf8e442378bd27b",
+    "hash": "9dbfae38a1704d3e71421c1247a1daae50823c5d",
-    "sri": "cQZFCHj63hTsPM7gSVu53B9hvZvX+zD5l7g9Yd7/flQ1+hwnyH3XmVuE4x79e2QYLaoAyRdk4GxsMjc3pGHfNg=="
+    "sri": "Lorhz3uzs484F4Sc9m4/1GkCrO990s9WHLtx+iQEOTxaccrIAekiZq1JK9unb1bbuy87Ooq0w5Ae0SMVXZlz1g=="
   }, {
     "path": "packages/banjerluke_sm-icons/font/sm-icons.20170510.woff",
     "where": "client",
     "type": "asset",
     "cacheable": false,
     "url": "/__cordova/packages/banjerluke_sm-icons/font/sm-icons.20170510.woff",
     "size": 15312,
     "hash": "8da3b422aeb2476b2fd997ee8d04e5220e561ee8",
     "sri": null
   }, {
#
#  ... not showing about 235 identical asset definitions
#
   }, {
     "path": "head.html",
     "where": "internal",
     "type": "head",
     "hash": "5a7de9220ac34db6ed02b1128fa5cfec6be5ef4b"
   }],
-  "version": "4d5cceec9f67bc96033ebbf684dc7200ec55d1a3",
+  "version": "4ebf04175f5f367b78a216cae3b81f9739fe47b8",
   "cordovaCompatibilityVersions": {
     "android": "00a8b67958ff80bb89180d7983ba1cec2526d849",
     "ios": "f0a6d141c465c3fe8edcfcdc23af25c5f46ee152"
   },
   "PUBLIC_SETTINGS": {
#
# these are identical
#
   },
# see below for a cleaner diff of the next line
-  "meteorRuntimeConfig": "{\"meteorRelease\":\"METEOR@1.10.2\",\"gitCommitHash\":\"4d5cceec9f67bc96033ebbf684dc7200ec55d1a3\",\"meteorEnv\":{\"NODE_ENV\":\"production\",\"TEST_METADATA\":\"{}\"},\"PUBLIC_SETTINGS\":{\"stripe\":{\"publishableKey\":\"pk_live_EgrlKUnLQxpPDceGThCqfp5V\"},\"googleAnalytics\":{\"trackingId\":\"UA-75162964-1\"},\"amplitude\":{\"apiKey\":\"e2a79556e297512f25b77b550a32705a\"},\"sentry\":{\"dsn\":\"https://cccea5e4496a413e96faa852a3859981@sentry.io/171894\"}},\"ROOT_URL\":\"https://beta.strummachine.com/\",\"ROOT_URL_PATH_PREFIX\":\"\",\"kadira\":{\"appId\":\"gZDfn3RZsLaEaweKM\",\"endpoint\":\"https://engine.montiapm.com\",\"clientEngineSyncDelay\":10000,\"recordIPAddress\":\"full\",\"enableErrorTracking\":true},\"autoupdate\":{\"versions\":{\"web.browser\":{\"version\":\"4d5cceec9f67bc96033ebbf684dc7200ec55d1a3\",\"versionRefreshable\":\"4d5cceec9f67bc96033ebbf684dc7200ec55d1a3\",\"versionNonRefreshable\":\"4d5cceec9f67bc96033ebbf684dc7200ec55d1a3\"},\"web.browser.legacy\":{\"version\":\"4d5cceec9f67bc96033ebbf684dc7200ec55d1a3\",\"versionRefreshable\":\"4d5cceec9f67bc96033ebbf684dc7200ec55d1a3\",\"versionNonRefreshable\":\"4d5cceec9f67bc96033ebbf684dc7200ec55d1a3\"},\"web.cordova\":{\"version\":\"4d5cceec9f67bc96033ebbf684dc7200ec55d1a3\",\"versionRefreshable\":\"4d5cceec9f67bc96033ebbf684dc7200ec55d1a3\",\"versionNonRefreshable\":\"4d5cceec9f67bc96033ebbf684dc7200ec55d1a3\"}},\"autoupdateVersion\":null,\"autoupdateVersionRefreshable\":null,\"autoupdateVersionCordova\":null,\"appId\":\"1ipv1tp12xzfzhba088c\"},\"appId\":\"1ipv1tp12xzfzhba088c\",\"accountsConfigCalled\":true,\"DDP_DEFAULT_CONNECTION_URL\":\"https://beta.strummachine.com/\"}",
+  "meteorRuntimeConfig": "{\"meteorRelease\":\"METEOR@1.10.2\",\"gitCommitHash\":\"4ebf04175f5f367b78a216cae3b81f9739fe47b8\",\"meteorEnv\":{\"NODE_ENV\":\"production\",\"TEST_METADATA\":\"{}\"},\"PUBLIC_SETTINGS\":{\"stripe\":{\"publishableKey\":\"pk_live_EgrlKUnLQxpPDceGThCqfp5V\"},\"googleAnalytics\":{\"trackingId\":\"UA-75162964-1\"},\"amplitude\":{\"apiKey\":\"e2a79556e297512f25b77b550a32705a\"},\"sentry\":{\"dsn\":\"https://cccea5e4496a413e96faa852a3859981@sentry.io/171894\"}},\"ROOT_URL\":\"https://beta.strummachine.com/\",\"ROOT_URL_PATH_PREFIX\":\"\",\"kadira\":{\"appId\":\"gZDfn3RZsLaEaweKM\",\"endpoint\":\"https://engine.montiapm.com\",\"clientEngineSyncDelay\":10000,\"recordIPAddress\":\"full\",\"enableErrorTracking\":true},\"autoupdate\":{\"versions\":{\"web.browser\":{\"version\":\"4ebf04175f5f367b78a216cae3b81f9739fe47b8\",\"versionRefreshable\":\"4ebf04175f5f367b78a216cae3b81f9739fe47b8\",\"versionNonRefreshable\":\"4ebf04175f5f367b78a216cae3b81f9739fe47b8\"},\"web.browser.legacy\":{\"version\":\"4ebf04175f5f367b78a216cae3b81f9739fe47b8\",\"versionRefreshable\":\"4ebf04175f5f367b78a216cae3b81f9739fe47b8\",\"versionNonRefreshable\":\"4ebf04175f5f367b78a216cae3b81f9739fe47b8\"},\"web.cordova\":{\"version\":\"4ebf04175f5f367b78a216cae3b81f9739fe47b8\",\"versionRefreshable\":\"4ebf04175f5f367b78a216cae3b81f9739fe47b8\",\"versionNonRefreshable\":\"4ebf04175f5f367b78a216cae3b81f9739fe47b8\"}},\"autoupdateVersion\":null,\"autoupdateVersionRefreshable\":null,\"autoupdateVersionCordova\":null,\"appId\":\"1ipv1tp12xzfzhba088c\"},\"appId\":\"1ipv1tp12xzfzhba088c\",\"accountsConfigCalled\":true,\"DDP_DEFAULT_CONNECTION_URL\":\"https://beta.strummachine.com/\"}",
   "refreshableAssets": [{
-    "url": "/__cordova/48820e30dc846ddbb0d986595bf8e442378bd27b.css?meteor_css_resource=true"
+    "url": "/__cordova/9dbfae38a1704d3e71421c1247a1daae50823c5d.css?meteor_css_resource=true"
   }]
 }
Diff of (beautified) `meteorRuntimeConfig` value
 {
   "meteorRelease": "METEOR@1.10.2",
-  "gitCommitHash": "4d5cceec9f67bc96033ebbf684dc7200ec55d1a3",
+  "gitCommitHash": "4ebf04175f5f367b78a216cae3b81f9739fe47b8",
   "meteorEnv": {
     "NODE_ENV": "production",
     "TEST_METADATA": "{}"
   },
   "PUBLIC_SETTINGS": {
#
# these are identical
#
   },
   "ROOT_URL": "https://beta.strummachine.com/",
   "ROOT_URL_PATH_PREFIX": "",
   "kadira": {
# identical config
   },
   "autoupdate": {
     "versions": {
       "web.browser": {
-        "version": "4d5cceec9f67bc96033ebbf684dc7200ec55d1a3",
-        "versionRefreshable": "4d5cceec9f67bc96033ebbf684dc7200ec55d1a3",
-        "versionNonRefreshable": "4d5cceec9f67bc96033ebbf684dc7200ec55d1a3"
+        "version": "4ebf04175f5f367b78a216cae3b81f9739fe47b8",
+        "versionRefreshable": "4ebf04175f5f367b78a216cae3b81f9739fe47b8",
+        "versionNonRefreshable": "4ebf04175f5f367b78a216cae3b81f9739fe47b8"
       },
       "web.browser.legacy": {
-        "version": "4d5cceec9f67bc96033ebbf684dc7200ec55d1a3",
-        "versionRefreshable": "4d5cceec9f67bc96033ebbf684dc7200ec55d1a3",
-        "versionNonRefreshable": "4d5cceec9f67bc96033ebbf684dc7200ec55d1a3"
+        "version": "4ebf04175f5f367b78a216cae3b81f9739fe47b8",
+        "versionRefreshable": "4ebf04175f5f367b78a216cae3b81f9739fe47b8",
+        "versionNonRefreshable": "4ebf04175f5f367b78a216cae3b81f9739fe47b8"
       },
       "web.cordova": {
-        "version": "4d5cceec9f67bc96033ebbf684dc7200ec55d1a3",
-        "versionRefreshable": "4d5cceec9f67bc96033ebbf684dc7200ec55d1a3",
-        "versionNonRefreshable": "4d5cceec9f67bc96033ebbf684dc7200ec55d1a3"
+        "version": "4ebf04175f5f367b78a216cae3b81f9739fe47b8",
+        "versionRefreshable": "4ebf04175f5f367b78a216cae3b81f9739fe47b8",
+        "versionNonRefreshable": "4ebf04175f5f367b78a216cae3b81f9739fe47b8"
       }
     },
     "autoupdateVersion": null,
     "autoupdateVersionRefreshable": null,
     "autoupdateVersionCordova": null,
     "appId": "1ipv1tp12xzfzhba088c"
   },
   "appId": "1ipv1tp12xzfzhba088c",
   "accountsConfigCalled": true,
   "DDP_DEFAULT_CONNECTION_URL": "https://beta.strummachine.com/"
 }

Turns out that Cordova HCP breaks when sourcemaps are hidden. There’s a GitHub Issue about it.

We just hit the same issue and would love to keep having the source maps (hidden) to get better stack traces in Monto APM (Source Maps). It’s unclear to me if the work-around on the github link achieves this, or did you find another solution or work-around?

Thanks

The workaround does the trick for me. Been using it without issues for the past two years.