Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

157
Visualizações
live-server gives "Change detected" but chrome console doesn't, how do I make my change auto loaded?

I'm trying to have live-server auto reload the code once I save my change.

I've installed live-server globally and created a folder test and put 3 files in there

mkdir test
cd test
touch index.html main.js .live-server.json
live-server

Here's the contents of index.html

<script src='main.js'></script>

Here's the contents of main.js

console.log('hi');

and I got 'hi' in my chrome dev console.

When I changed the code, I got

Change detected /Users/ubuntu/dev/test/main.js

However, my chrome dev console didn't yield that change. I have to refresh the page manually. How do I make my change auto loaded?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Firstly update your browser and live-server package! Try to re-run your live-server without .live-server.json (remove it !) file because as we can read in docs:

If a file ~/.live-server.json exists it will be loaded and used as default options for live-server on the command line. See "Usage from node" for option names.

You need to add to your index.html boilerplate ! Now it should works like a charm! ;-)

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script src="main.js"></script>
  </body>
</html>

You can also try run live-server with different port like so:

live-server --port=5000
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda