Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

230
Vistas
Electron Forge Error - cannot read property 'close' of undefined

I just set up a basic electron-react app by using electron-forge and adding React+webpack+typescript per instructions and it all works great (I haven't added anything beyond the basic setup). It compiles well with all green checkboxes.

However, when I hit the close button by mouse clicking the x in the top right, it shuts down but gives the following error:

An unhandled exception has occurred inside Forge:
Cannot read property 'close' of undefined
TypeError: Cannot read property 'close' of undefined
    at WebpackPlugin.exitHandler (C:\Users\cwebb\Documents\Webdev\Atlas\node_modules\@electron-forge\plugin-webpack\src\WebpackPlugin.ts:83:16)
    at ChildProcess.<anonymous> (C:\Users\cwebb\Documents\Webdev\Atlas\node_modules\@electron-forge\plugin-webpack\src\WebpackPlugin.ts:171:18)
    at ChildProcess.emit (events.js:412:35)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
C:\Users\cwebb\Documents\Webdev\Atlas\node_modules\@electron-forge\plugin-webpack\dist\WebpackPlugin.js:87
          server.close();
                 ^

TypeError: Cannot read property 'close' of undefined
    at WebpackPlugin.exitHandler (C:\Users\cwebb\Documents\Webdev\Atlas\node_modules\@electron-forge\plugin-webpack\src\WebpackPlugin.ts:83:16)
    at process.<anonymous> (C:\Users\cwebb\Documents\Webdev\Atlas\node_modules\@electron-forge\plugin-webpack\src\WebpackPlugin.ts:126:40)
    at process.emit (events.js:412:35)
    at process.emit (C:\Users\cwebb\Documents\Webdev\Atlas\node_modules\source-map-support\source-map-support.js:516:21)
    at processEmit [as emit] (C:\Users\cwebb\Documents\Webdev\Atlas\node_modules\signal-exit\index.js:155:35)
    at process.exit (internal/process/per_thread.js:169:15)
    at process.<anonymous> (C:\Users\cwebb\Documents\Webdev\Atlas\node_modules\@electron-forge\cli\src\util\terminate.ts:20:11)
    at process.emit (events.js:400:28)
    at process.emit (C:\Users\cwebb\Documents\Webdev\Atlas\node_modules\source-map-support\source-map-support.js:516:21)
    at processEmit [as emit] (C:\Users\cwebb\Documents\Webdev\Atlas\node_modules\signal-exit\index.js:161:32)
    at process._fatalException (internal/process/execution.js:167:25)

Any recommendations as to how to correct this? I found one answer on a gitmemory site but it just said "thanks it worked" but no comment about how to fix the problem.

Thank you in advance for your help.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I just ran into this today and managed to find a hint here

You have to bind to the Electron app's window-all-closed event if you don't want this to happen. Usually, you'd use this event to quit the app when all the windows are closed. Here's an example snippet from main.js:

const { app } = require('electron')
app.on('window-all-closed', () => {
  app.quit() 
})

If you want the app to keep running after you close all windows, you can remove the call to app.quit, but make sure to keep the binding to window-all-closed. Having the binding prevents the exception from being thrown.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda