Reputation: 153
Full error is :
Pusher : Error : {"type":"WebSocketError","error": {"type":"PusherError","data":{"code":4005,"message":"Path not found"}}} app.js:47801 Pusher : State changed : connecting -> disconnected
this error show in console , when send event from https://dashboard.pusher.com/apps/489207/console/realtime_messages to console.log
bootstrap.js
import Echo from 'laravel-echo'
window.Pusher = require('pusher-js');
window.Echo = new Echo({
broadcaster: 'pusher',
key: process.env.MIX_PUSHER_APP_KEY,
cluster: process.env.MIX_PUSHER_APP_CLUSTER,
encrypted: true
});
also in config/broadcasting.php add cluster in pusher configuration
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'encrypted' => true,
],
],
app.js
mounted(){
Echo.private('chat')
.listen('ChatEvent',(e) => {
console.log(e);
});
}
Upvotes: 0
Views: 3335
Reputation: 388
don't forget to add Your pusher configuration in .env file
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
also check the channels Route and in your event class you should implement 'ShouldBroadcast'
Upvotes: 1