function createNewErrorOverlay(data) {
  if (!isWindowDefined) {
    return;
  }
  const HmrErrorOverlay = customElements.get('hmr-error-overlay');
  if (HmrErrorOverlay) {
    const overlay = new HmrErrorOverlay(data);
    clearErrorOverlay();
    document.body.appendChild(overlay);
  }
}
Create an error overlay (if custom element exists on the page).