Game no longer loads and canvas won't produce webgl context



  • The game no longer finishes loading. And when I resize the frozen screen I get a javascript error "cannot read property 'canvas' of null". That is because the web gl context cannot be retrieved from the canvas. Oddly this happened after my computer froze due to some heavy computations my computer was making. Even more odd is that I can not make the issue go away. I tried clearing all browser data from the catan site, but even that did not work. Below is the relevant part of the code that caused the crash, from the file top/catanuniverse.com/en/game from the sources tab of the debugger for google chrome. Hopefully you'll find the error so I can play again.

        function updateWebGLViewport (event) {
    
        console.log('updateWebGLViewport');
    
        // setting new size
        updateCanvasSizeAndPosition();
    
        // getting unity webGL instance
      // getting unity webGL instance
        var canvas = document.getElementById('canvas');
        var gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
    
        var realToCSSPixels = window.devicePixelRatio || 1;
    
        // Lookup the size the browser is displaying the canvas in CSS pixels
        // and compute a size needed to make our drawingbuffer match it in
        // device pixels.
        var displayWidth  = Math.floor(gl.canvas.clientWidth  * realToCSSPixels);


  • After restarting chrome the problem somehow disappeared.


Log in to reply