-
Notifications
You must be signed in to change notification settings - Fork 340
Cannot set property 'onopen' of null #808
Comments
Same issue here, this started to cause issues in our application E2E tests. When changing page it kills the connection and Cypress catches all uncaught errors thrown on the window it makes our test fail. Downgrading also worked for us. I guess also having One thing that is also super weird in the code is that But also might be interesting to look inside |
Same issue here, downgrading to 0.9.16 seemed to fixed it as @atdrago said, so 0.9.18 is probably broken. |
Any idea on when #829 could be merged? |
@alexandre-kairn recommend using https://github.com/ds300/patch-package with a patch like: diff --git a/node_modules/subscriptions-transport-ws/dist/client.js b/node_modules/subscriptions-transport-ws/dist/client.js
index 3202dcd..9f4b1ed 100644
--- a/node_modules/subscriptions-transport-ws/dist/client.js
+++ b/node_modules/subscriptions-transport-ws/dist/client.js
@@ -122,12 +122,13 @@ var SubscriptionClient = (function () {
this.unsubscribeAll();
this.sendMessage(undefined, message_types_1.default.GQL_CONNECTION_TERMINATE, null);
}
- this.client.close();
- this.client.onopen = null;
- this.client.onclose = null;
- this.client.onerror = null;
- this.client.onmessage = null;
+ const client = this.client;
this.client = null;
+ client.close();
+ client.onopen = null;
+ client.onclose = null;
+ client.onerror = null;
+ client.onmessage = null;
this.eventEmitter.emit('disconnected');
if (!isForced) {
this.tryReconnect(); |
@ibash Thanks, indeed we went with something along those lines 👍 I was hoping to remove the patch when a new version is released, but at least this fixes the issue for now. |
|
Hi,
We started receiving
Cannot set property 'onopen' of null
errors in sentry after upgrading subscriptions-transport-ws to v0.9.18A quick search sent me to this PR with 2 people discussing the issue: #615 (comment)
This error occurs only a few times a day so it is hard to create a reproduction repo, I have not looked deeply into it for now so I don't know if the suggested fix by @dko-slapdash would work.
I am not very familiar with the subscriptions-transport-ws, could someone look into it ?
Any help would we greatly appreciated :)
deps:
The text was updated successfully, but these errors were encountered: