electron / forge

:electron: A complete tool for building and publishing Electron applications
https://electronforge.io
MIT License
6.41k stars 505 forks source link

Unable to override webpack-dev-server client.overlay configuration for renderer process #3265

Open kbuzby opened 1 year ago

kbuzby commented 1 year ago

Pre-flight checklist

Electron Forge version

6.2.1

Electron version

25.2.0

Operating system

macOS

Last known working Electron Forge version

No response

Expected behavior

Override webpack devServer.client.overlay config

Actual behavior

Adding

devServer: {
    client: {
      overlay:  false
    }
  }

to webpack.renderer.config.ts has no effect at runtime - I continue to get overlay errors with this configuration set.

Steps to reproduce

  1. electron-forge project with webpack-typescript template + add react capability
  2. trigger a runtime error in the renderer code a. I have been getting this in project after configuring a two panel layout with react-split and react-monaco-editor in the right pane (without automaticLayout: true). Running the application and using the resizable divider leads to "ResizeObserver loop limit detected" runtime error. From what I can tell this is benign (which is wanted to suppress this error).
  3. still observe the overlay for runtime error despite configuring it to not show. I've also observed this in the various forms of trying to disable the error (overlay: { runtimeErrors: false }, overlay: { runtimeErrors: (error) => {...} })

Additional information

This seems potentially related to #2599

szszoke commented 5 months ago

I am also affected by this problem. I solved it by adding a CSS rule to my page that just sets display: none on the iframe that Webpack injects for the overlay.

#webpack-dev-server-client-overlay {
    display: none;
}
Keller18306 commented 4 weeks ago

try, this works for me

devServer: {
  client: {
    overlay: {
      errors: false,
      warnings: false
    }
}