diff --git a/frontend/express/public/javascripts/countly/vue/core.js b/frontend/express/public/javascripts/countly/vue/core.js index 1a9e40f53f6..82b73452bc8 100644 --- a/frontend/express/public/javascripts/countly/vue/core.js +++ b/frontend/express/public/javascripts/countly/vue/core.js @@ -619,6 +619,18 @@ Vue.prototype.$route = new BackboneRouteAdapter(); + // countlyGlobal is a window-level global, but Vue 2's render proxy does not fall + // through to window for identifiers in template expressions, so a bare + // countlyGlobal.* in a template resolves to undefined and throws during render. + // Expose it on the prototype (via a getter so it always reflects the current + // window.countlyGlobal) so templates can use countlyGlobal.* safely. + Object.defineProperty(Vue.prototype, "countlyGlobal", { + configurable: true, + get: function() { + return window.countlyGlobal; + } + }); + var DummyCompAPI = VueCompositionAPI.defineComponent({ name: "DummyCompAPI", template: '
',