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

637
Vistas
Vite.js (Vue): Unwanted Page Reload Happens Only On Samsung Internet

I have a weird problem with Vite.js and it only happens on Samsung Internet when I'm on development server...

Problem: page reloads automatically 3 seconds in a loop and I don't set nor write any intervals... the page reload happens at browser level.

These are unwanted reloads and I want to get rid of them.

Any Idea why it happens?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Edited asnwer:

Ok so, I looked closer to this problem and I found some possible solutions.

Samsung Internet (same as Chrome) doesn't allow unsecure websocket (ws) connections to localhost (only wss, so you should setup a TLS certificate for your local web/websocket server). However the same should work fine with Firefox.

Another reason for this error could be "overloading" the same port. Maybe other app, which you are running, uses port 3000. The solution would be to stop that process or again change the port.

Testing solution: Does the code works if you do this?

// Original line
new WebSocket(`${socketProtocol}://${socketHost}`, 'vite-hmr')


// Replace with exact url with port that you are running the app
new WebSocket("ws://localhost:3000")
over 4 years ago · Santiago Trujillo Denunciar

0

It seems Samsung Internet browser disallows insecure websockets.

A workaround is to enable HTTPS in Vite with server.https, so that it creates a secure Websocket:

// vite.config.js
import { defineConfig } from 'vite'

export default defineConfig({
  ⋮
  server: {
    https: true,
  }
})

Verified with Vite 2.7.13 and Samsung Internet 16.0.6.23

over 4 years ago · Santiago Trujillo 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