WebSocket.Server is not a constructor
See original GitHub issuecontent is same with title.
I used ‘ws’ module in electron main process not browser.
It work on local environment, but occur error with message ‘WebSocket.Server is not a constructor’ when packaging.
I’m tried to solve this with add external: ['WebSocket', 'WebSocketServer'] in webpack.config.js. but It didn’t work.
anyone who can solve this problem. please, tell me how to solve.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:13 (2 by maintainers)
Top Results From Across the Web
issue in understandind `WebSocketServer` is not a class
It's .Server , not .server . Here's an example: const WebSocket = require('ws'); const wss = new WebSocket.Server({ port: 8080 }).
Read more >WebSocket is not a constructor - Bugzilla@Mozilla
Please note: I am having Python issues with the WebSocket test server on my computer, so I haven't been able to run all...
Read more >websocket server is not a constructor #528 - Issuehunt
websocket server is not a constructor #528 ... with the following code: const WebSocketServer = require('ws').Server; this.serverPort = 8081; const wss = new ......
Read more >ws.websocket server is not a constructor - 掘金
ws.websocket server is not a constructor技术、学习、经验文章掘金开发者社区搜索结果。掘金是一个帮助开发者成长的社区,ws.websocket server is not a constructor ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
There is no
ws.Serverin the ESM version, useimport { WebSocketServer } from 'ws'instead.I’m getting this with ESM:
package.json: