Live Reload is not possible without body or head tag
See original GitHub issueI’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ x ] Bug report <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Feature request
[ ] Documentation issue or request
[ ] Other: <!-- Please describe: -->
Current behavior
The web browser shows something when I just run the extension and connect to a port No. but when I make changes to my html files the error message (“Live Reload is not possible without body or head tag”) pops up and the web browser shows nothing (blank). I have to close the server and reconnect it every time for web browser to show the new web contents. When I added an extra <html>
or </html>
the Live Server works fine for some reason.
I installed Live Server 8 months ago and it worked fine until recently when I tried to use it again after 4 months of inactivity and updated to the new version of it. I tried to open my old html documents that used to work fine with Live Server and don’t work fine with it now. I thought I might have changed my codes and copied some codes from https://www.w3schools.com/html/default.asp but the Live Server behaved the same way.
The codes I copied from the link and with issue
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
The codes that work fine with extra <html>
or </html>
<!DOCTYPE html>
<html>
<html> <!-- extra -->
<head>
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
<!DOCTYPE html>
<html>
</html> <!-- extra -->
<head>
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
Expected behavior
It should reload and work without the extra <html> or </html>, like last time, without problem.
Environment
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] IE version XX
- [ x ] Edge version 42.17134.1.0
For Tooling issues:
- Live Server: 5.3.0
- Platform: Windows
- Visual Studio Code: 1.30.2
Others
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top GitHub Comments
This is not the solution. The problem is not the annoying notification, but the fact that auto-reload doesn’t work. In my case is even worse - instead of the mentioned notification, Live Server shows a blank page, doesn’t matter what I type as a code.
After reading other posts decided to make a small change in the index.html page from: charset=“UTF-8” to “utf-8” and it started to work again.