got undefined error on pusher:subscription_error event.
See original GitHub issueDo you want to request a feature or report a bug?
bug
What is the current behavior?
got undefined error on pusher:subscription_error event.
pusher:subscription_error { type: 'AuthError', error: undefined } undefined
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar.
const pusher = new Pusher(env.PUSHER_APP_KEY, {
cluster: env.PUSHER_APP_CLUSTER,
authEndpoint: 'https://my-server/channels/auth',
auth: {
headers: {
'Authorization': 'Bearer token',
},
},
});
const channelName = 'presence-agents';
const channel = await pusher.subscribe(channelName);
console.log('subscribed channel', channelName);
channel.bind('pusher:subscription_error', (error, data) => {
console.error('pusher:subscription_error', error, data);
});
What is the expected behavior?
the error param should not be undefined.
Which versions of Pusher, and which browsers / OS are affected by this issue? Did this work in previous versions of Pusher? If so, which?
pusher-js: 7.0.0 node: v12.16.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
VueJS - Invalid handler for event "click": got undefined
I have got the similar error when the click function was implemented as computed function. Problem got resolved after the function got moved ......
Read more >Deal with Undefined 'this' in React Event Handlers Correctly
You think this is pointing to the Sample class, but what you get is a nasty error. TypeError: Cannot read property 'foo' of...
Read more >$A.get for application event is undefined, or can only fire ...
If I use $A.get to get the event one level up and refer to that in the click handler, I can only fire...
Read more >event error handler javascript Undefined.
if I put it in a document ready function I get undefined. not sure what to do. index view. @model Jlo4MVC.Models.UserToSend.
Read more >Event Tickets Plus – Undefined Function
After updating the plugins I received a Undefined Function Error for the function: tribe_tickets_new_views_is_enabled();. I looked through all the files for ...
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 FreeTop 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
Top GitHub Comments
@leesio thanks for reply,
I’m using pusher-js package in a node environment so there is no browser network data to show.
you can reproduce this issue by calling channel auth API that response unexpected data with http 200 status code.
for example:
then pusher-js will emit a “pusher:subscription_error” event with undefined error.
this issue is not a critical bug but may cause debugging more difficult.
I guess the other option is to handle active (persistent) sessions from within your application, to compliment the pusher api for this issue https://github.com/pusher/pusher-js/issues/485