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

482
Vistas
Receiving Error: xhr poll error socket.io client React

I am receiving an Error: xhr poll error in the connect_error event when trying to connect to my websocket gateway. I am using "socket.io-client": "^4.2.0".

import { io } from "socket.io-client";

const ENDPOINT = "http://localhost:3001";

const socket = io(ENDPOINT);

socket.on("connect_error", (e: any) => {
   console.log(e);
});
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can try to set up the client connection to use only websocket transport. By default it is using weboscket and polling.

{
   transports: ['websocket']
}

So your code will become:

const socket = io(ENDPOINT, {
   transports: ['websocket']
});
about 4 years ago · Juan Pablo Isaza Denunciar
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