Closed bennycode closed 6 years ago
I also ran into this issue, and found a similar one here. It turns out removing "module": "./dist/reconnecting-websocket.mjs",
in the package.json
fixes the issue in create-react-app.
Hi @bennyn,
Version 4 of this library was a full rewrite with breaking changes. To pass a custom WebSocket class you must now use WebSocket
option (not constructor
). You can have a look at the test suite for examples.
I've just updated dependencies and tests run with ws@^6.1.0
without problems.
Let me know if you find any other issue.
@jlarmstrongiv, I think your issue is unrelated. Can you please open a new issue providing more context?
I'm having this issue in NodeJS with
reconnecting-websocket
v4.2.0,
ws
v7.2.0, and
node
v10.15.0
The global value for WebSocket
getting passed to isWebSocket
is undefined
.
Should I open a new issue?
Any resolution?
My application is written in TypeScript and I am using reconnecting-websocket v3.2.2 in combination with the html5-websocket v2.0.4 interface. My goal is to run my application in a Node.js environment or a Browser environment and this is currently working with the following piece of code:
Now I have seen that the "html5-websocket" is deprecated (since the "ws" package supports the export of a WebSocket interface) and that "reconnecting-websocket" got bumped to version 4. That's why I rewrote my code to the following:
Compilation works just fine but when I want to test my code I get the following error from "reconnecting-websocket" v4.1.5 when running in a Node.js environment:
It doesn't seem to be happy with the
NodeWebSocket
interface. What can I do about this? I am using "ws" v6.1.0.