I have found a workaround. It seems like the configureEcho() setup function from @laravel/echo-vue is broken. If I set up Echo the plain JS way it works:
app.js: Replace this:
import { configureEcho } from '@laravel/echo-vue';
configureEcho({
broadcaster: 'reverb'
});
With this:
import Echo from 'laravel-echo';
import Pusher from 'pusher-js';
window.Pusher = Pusher;
window.Echo = new Echo({
broadcaster: 'reverb',
key: import.meta.env.VITE_REVERB_APP_KEY,
wsHost: import.meta.env.VITE_REVERB_HOST,
wsPort: import.meta.env.VITE_REVERB_PORT ?? 80,
wssPort: import.meta.env.VITE_REVERB_PORT ?? 443,
forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https',
enabledTransports: ['ws', 'wss'],
});
Vue component: Replace this:
useEchoPublic(`terminals.${this.terminalId}`, "RefreshTerminal", (e) => {
console.log('refresh');
console.log(e);
});
With this:
window.Echo.channel(`terminals.${this.terminalId}`)
listen('RefreshTerminal', () => {
location.reload();
});
And now I am receiving broadcast events successfully.
Seems the @laravel/echo-vue package broken?