tiagosiebler / binance

Node.js & JavaScript SDK for Binance REST APIs & WebSockets, with TypeScript & browser support, integration tests, beautification & more.
MIT License
747 stars 266 forks source link

Websocket dependency conflict #322

Closed alexk984 closed 7 months ago

alexk984 commented 1 year ago

After install this package I have this error when creating websocket:

TypeError: ws_1.WebSocketServer is not a constructor

In this code:

 import { WebSocketServer } from 'ws'

 const ws = new WebSocketServer({ port: 9001 })

I see this difference in yarn.lock file:

image image

How can I fix it?

tiagosiebler commented 1 year ago

Is this because the version of ws used in this package is older than yours? Can you give me a tiny example to reproduce the issue? Thanks