Skip to content

WebSocket connection to 'ws://0.0.0.0:3000/ws' failed after call app.relaunch #3787

Open
@littlebutt

Description

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

7.6.0

Electron version

v33.2.1

Operating system

Windows 10(22H2)

Last known working Electron Forge version

No response

Expected behavior

I want to restart my app when settings changed. After searching the electron docs here, I added the following codes:

ipcMain.handle('restart', () => {
    app.relaunch()
    app.quit()
  })

The expected behavior is I can restart the app correctly.

Actual behavior

When I invoked restart, the app did restart but showed following errors in the browser console

VM5:86 WebSocket connection to 'ws://0.0.0.0:3000/ws' failed: Error in connection establishment: net::ERR_SOCKET_NOT_CONNECTED

I did not use WebSocket in my project and the ONLY place I can find ws dependency is in electron-forge

"node_modules/@electron-forge/web-multi-logger": {
      "version": "7.6.0",
      "resolved": "https://registry.npmjs.org/@electron-forge/web-multi-logger/-/web-multi-logger-7.6.0.tgz",
      "integrity": "sha512-Ln4Rn1H/hxs9USvwWmvUYnOIR8kobtglYWJXCERrua8A0zCWsVrs3edO/oKrg68eBd30tiDiJYGLme1ZEXxt+A==",
      "dev": true,
      "dependencies": {
        "express": "^4.17.1",
        "express-ws": "^5.0.2",
        "xterm": "^4.9.0",
        "xterm-addon-fit": "^0.5.0",
        "xterm-addon-search": "^0.8.0"
      },
      "engines": {
        "node": ">= 16.4.0"
      }
    }

Steps to reproduce

Just call app.relaunch and app.quit after the app isReady

Additional information

No response

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions