Closed laurentmahieu closed 4 years ago
That error looks like it's trying to find a subscription so it can call the received
callback on it but in your case, the subscription doesn't seem to exist.
Kindly share code snippets of your channels
object and you subscribing and I just might be able to spot the problem.
Thank you !
I have several more or less complex channels, I don't know which one is problematic.
here is an example of a simple:
channels: {
RoomChannel: {
connected() {},
rejected() {},
received(data) {
if (data.hasOwnProperty("content")) {
this.messages.push(data);
this.scollToBottom();
}
},
disconnected() {}
}
},
And here my subscribing:
ActionCableConnect() {
let urlConnect = '${
config.ws_url
}cable?Okta-Access-Token=${getAccessToken()}&Okta-Id-Token=${getIdToken()}';
Vue.use(ActionCableVue, {
debug: config.websocket_debug,
debugLevel: "all",
connectionUrl: urlConnect,
connectImmediately: true
});
},
I think you should look through your subscriptions. You seem to be making at least one incorrect subscription.
For anyone who runs into this in the future, this is why we were seeing it:
actioncable@5.x
{"type":"disconnect","reason":"unauthorized","reconnect":false}
We were able to resolve the issue by upgrading to @rails/actioncable@6.x
TypeError : cannot read property 'received' of undefined
Expected behaviour Hi, I join the project recently. We are using actioncable-vue, we received message. Everything seems to be ok. But in our sentry we get an error ( screenshot. ).
According to Sentry, the problem should come from
node_modules/actioncable-vue/dist/actioncablevue.js
. Someone got this problem? someone could explain, where could problem come from ?Screenshots