tapio / live-server

A simple development http server with live reload capability.
http://tapiov.net/live-server/
4.41k stars 484 forks source link

I start the live-server in a folder, open a html, make a change. #359

Open tik9 opened 3 years ago

tik9 commented 3 years ago
Before submitting an issue, please, see https://github.com/tapio/live-server#troubleshooting

Issue description

I start the live-server in a folder, the folder gets opened in chrome, I open a html in an editor, make a change. No change in the browser, but on cmd: Change detected C:\Users\User\documents\te.html

Software details

gmoqa commented 3 years ago

Same here

OS: Linux Manjaro Browser : Firefox npm version: 6.14 live-server version : 1.2.1

ArtskydJ commented 3 years ago

I had this issue, and fixed it by adding a </head> or </body> tag in my HTML. https://github.com/tapio/live-server/blob/92e774242838fdae1f749a00cb680a444c2456c2/index.js#L45

gmoqa commented 3 years ago

fixed, just update

tik9 commented 3 years ago

@gmoqa how did you fix?

DevT0ny commented 3 years ago

@gmoqa how did you fix?

npm i live-server -g this will update live-server.

reyronald commented 3 years ago

This is still happening in the latest version (1.2.1 at the monent). Live reload won't work unless there's a tag in the HTML the script can be injected on (body, head, and svg).

Ideally this could work regardless. Is there a reason why the library can't create any of those tags if they don't exist ?

beetle442002 commented 2 years ago

Just as a reference this applies seems to apply to the atom-live-server https://github.com/jas-chen/atom-live-server