@Leonidas Yes you are right with the synthax, also yes I have a canvas var, but still on page load CTRl+F5 it throws the error. Not when the ap is once loaded. For now I didn’t do anything fancy with PlayCanvas. I assume its a Vue.js thing using this window.addEventListener which is maybe not the Vue way…
I am pretty sure you will need the DOM element to access width/height. So try running this after Vue has completed setting up the DOM (maybe look for vue nextTick).