title: How to solve CSS2Properties doesn't have an indexed property setter for '0' error on Firefox?
body: <p>I'm creating a div element throught Javascript and I want to copy the styles of the canvas initialized by a game engine that I'm using. I used Object.assign to achieve this and it works perfectly on Chrome, but when I tested on Firefox I got this error and it doesn't allow me to continue with my game. I'm leaving the function code below:</p>
  
  <pre><code>export const addCanvasOverlay = (id) =&gt; {
    const canvas = game.system.canvas;
    const overlay = document.createElement('DIV');
    overlay.id = id;
    /**
     * Clone canvas style to ensure the overlay is always over it
     */
    const trackCanvasSize = () =&gt; {
      Object.assign(overlay.style, canvas.style);
      overlay.style['pointer-events'] = 'none';
    };
    window.addEventListener('resize', trackCanvasSize);
    trackCanvasSize();
    canvas.parentNode.appendChild(overlay);
    return overlay;
  }
  </code></pre>
  
  <p>Does anyone know what might be causing this?</p>
  
  <p>This is what I get on canvas.style besides the style normal properties:</p>
  
  <p><a href="https://i.stack.imgur.com/Mq7aP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Mq7aP.png" alt="canvas.style"></a></p>