Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
littlebutt opened this issue Dec 16, 2024 · 0 comments
Open
3 tasks done

Comments

@littlebutt
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant