Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

277
Vistas
Vue3 laravel-echo with pusher-js not triggering events

I am trying to iplement websocket using VUE3 + LARAVEL-ECHO + PUSHER-JS

<script lang="ts">
import { defineComponent, ref, computed, onMounted, onBeforeMount } from 'vue'
import Echo from 'laravel-echo'
declare global {
    interface Window {
        Pusher:any;
        Echo:any;
    }
}
window.Pusher = require('pusher-js');
window.Echo = new Echo({
  broadcaster: 'pusher',
  key: 'mykey',
  cluster: 'mt1',
  secret: 'mysecret',
  wsHost: 'variant.uz',
  wsPort: 6001,
  forceTLS: false,
  disableStats: true,
});
export default defineComponent({
  name: 'MainLayout',
  components: {
  },
  setup () {
    onMounted(()=>{
      window.Echo.listen('EventTriggered','GetRequestEvent', (e:any)=>{
        console.log(e);
      })
    })
    return {}
  }
})
</script>

In the browser dev tools I can see that I connected to the channel, end when event emitted there is also in dev tools Network I see the data sent, but this lines are not triggering

window.Echo.listen('EventTriggered','GetRequestEvent', (e:any)=>{
        console.log(e);
      })
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda