Every time I save a watched file, my page reloads, but in VS code the warning appears "Live Reload is not possible as body or head tag or defined tag is missing in HTML". I have to close the warning every time (very annoying) and there is no option to disable this warning.
okay! It's added in new version. Add
or tag in html. It will disappear.Without
or tag live reload is not possible.Have you meant that? or am I getting wrong point? Let me know.
If you have better suggestion, you're also welcome.
1) I don't understand the current behaviour, because the warning is saying that live reload won't work, but it is working... So, I think the warning comes at the wrong time. So this might be a bug... (or I don't fully understand the purpose of the warning :-) )
2) If this tag-problem occurs, I think it's better to show the warning only once in VS code and not on every save. And it might be better to show the warning in the console.
Okay! I understand. And definitely as I always give priority on feedback, I am adding a settings so that we can turn off the warring message.
And If it is bug, can you tell me that what platform you are using? and please give a try as follow : ->
And now please tell me, is this working? or you're still getting the warning?.
I want to know if it is a bug or not before releasing new version. Because it is working on my Windows 10
It is working (without a warning) when I create a new file in new folder. So there must be something wrong in my file?
The structure of my file is :
<!DOCTYPE html>
<html ng-app="TestApp">
<head>
</head>
<body ng-controller="testCtrl">
</body>
</html>
So I think there shouldn't be a warning, because I have head and body tags?
(I'm also working in windows 10)
Is this not working for you?........ I tried....
<!DOCTYPE html>
<html ng-app="TestApp">
<head>
</head>
<body ng-controller="testCtrl">
</body>
</html>
it is working for me....
yes, it works if I try it with that simple structure, but with my complete code, it is still showing the warning.
Does it matter which code is between the head and body tags? I would expect that the existence of head/body-tags is enough? But apparently, some of my code between the head-tags or the body-tags is triggering that warning...
This issue has been fixed with v2.1.1 update. Please update it from vscode marketplace 😄.
If you like the extension, please drop a review to vscode marketplace.


Hello. Sorry for request, but I have same problem with LiveServer. When I create new document, type (!) and tab, VSCode create base html structur automaticly. But if i add some tags in head or body, than LiveReload warning than "Live Reload is not possible without body or head tag."
Same issue here. As per above.
Same issue here. As per above.
@martonberecz
I think I found a solution - try creating the html file in the file explorer instead of powershell/terminal.
I had the same problem. I just "solved" it by pressing 'I understand - don't show again'.
I had the same problem. I just "solved" it by pressing 'I understand - don't show again'.
I had the same problem and tried the same step to 'Don't show again'. I had to reload the page in the browser and then make a change to the html file and save it in VSCode.
My HTML has body and head tag, and I am still getting the message ...
I have just had the same problem having not had an issue for 12+ months.
A new .html file with exactly the same content would work so slightly confused. Ended up deleting my index.html and creating a new one then pasting the content over and it worked.
As a side note - my original .html file was created in the terminal and my "working" .html created in VSC as referenced above.
Strange one.
Also having this problem
I've seen issues with the file encoding (UTF-16 has caused it to complain about HEAD or BODY missing)
I'm working with HTML5 which doesn't need these tags, and should have Live Server's snippet simply appended to the end of the document. Could you change the extension so that if </body> is not found, it just adds its code to the end and doesn't give this warning?
I̵ ̵b̵e̵l̵i̵e̵v̵e̵ ̵t̵h̵i̵s̵ ̵m̵i̵g̵h̵t̵ ̵b̵e̵ ̵a̵ ̵p̵r̵o̵b̵l̵e̵m̵ ̵w̵i̵t̵h̵ ̵t̵h̵e̵ ̵e̵x̵t̵e̵n̵s̵i̵o̵n̵ ̵"̵B̵r̵o̵w̵s̵e̵r̵ ̵P̵r̵e̵v̵i̵e̵w̵"̵ ̵a̵t̵ ̵h̵t̵t̵p̵s̵:̵/̵/̵m̵a̵r̵k̵e̵t̵p̵l̵a̵c̵e̵.̵v̵i̵s̵u̵a̵l̵s̵t̵u̵d̵i̵o̵.̵c̵o̵m̵/̵i̵t̵e̵m̵s̵?̵i̵t̵e̵m̵N̵a̵m̵e̵=̵a̵u̵c̵h̵e̵n̵b̵e̵r̵g̵.̵v̵s̵c̵o̵d̵e̵-̵b̵r̵o̵w̵s̵e̵r̵-̵p̵r̵e̵v̵i̵e̵w̵.̵ ̵B̵u̵t̵ ̵I̵ ̵a̵d̵m̵i̵t̵ ̵i̵t̵ ̵i̵s̵ ̵j̵u̵s̵t̵ ̵a̵ ̵g̵u̵e̵s̵s̵ ̵-̵ ̵I̵ ̵h̵a̵v̵e̵ ̵n̵o̵t̵ ̵d̵u̵g̵ ̵d̵e̵e̵p̵ ̵i̵n̵t̵o̵ ̵i̵t̵.̵
̵O̵n̵e̵ ̵w̵a̵y̵ ̵t̵o̵ ̵s̵e̵e̵ ̵i̵f̵ ̵m̵y̵ ̵h̵u̵n̵c̵h̵ ̵i̵s̵ ̵r̵i̵g̵h̵t̵,̵ ̵w̵o̵u̵l̵d̵ ̵b̵e̵ ̵t̵o̵ ̵i̵n̵v̵e̵s̵t̵i̵g̵a̵t̵e̵ ̵i̵f̵ ̵t̵h̵i̵s̵ ̵i̵s̵s̵u̵e̵ ̵e̵v̵e̵r̵ ̵o̵c̵c̵u̵r̵s̵ ̵w̵h̵e̵n̵ ̵t̵h̵e̵ ̵L̵i̵v̵e̵ ̵S̵e̵r̵v̵e̵r̵ ̵e̵x̵t̵e̵n̵s̵i̵o̵n̵ ̵s̵e̵t̵t̵i̵n̵g̵ ̵"̵U̵s̵e̵ ̵B̵r̵o̵w̵s̵e̵r̵ ̵P̵r̵e̵v̵i̵e̵w̵"̵ ̵i̵s̵ ̵u̵n̵c̵h̵e̵c̵k̵e̵d̵.̵
ONE work-around that works for me, whether you like it or not, is to click the reload button of the "Preview" browser.
it happened to me too and it was very irritating so i turned it off from settings.json
"liveServer.settings.donotShowInfoMsg": true,
"liveServer.settings.donotVerifyTags":true,
it happened to me too and it was very irritating so i turned it off from settings.json
"liveServer.settings.donotVerifyTags": off,
How did you get this working? It would appear that this takes true or false rather than off but I couldn't get rid of the warning or get live reloads working with any value.
it happened to me too and it was very irritating so i turned it off from settings.json
"liveServer.settings.donotVerifyTags": off,How did you get this working? It would appear that this takes
trueorfalserather thanoffbut I couldn't get rid of the warning or get live reloads working with any value.
i think this did it for me
"liveServer.settings.donotShowInfoMsg": true,
"liveServer.settings.donotVerifyTags":true,
@mrmatata That gets rid of the message but auto reloading still doesn't work unless there is </body> in the document (no other tags are needed).
I had the same problem. I just "solved" it by pressing 'I understand - don't show again'.
This somehow fixed it for me a s well, btw I know this is old but still happening in version 5.6.1
Hey everyone, so today I got the live server to work by downloading an older version (v 1.0) and it worked so far. I'm not getting that dreaded live server needs a head or body tag message and more importantly my webpage reloads without me having to hit ctrl + R (or F5). I haven't received any issues, you can give a try and let me know
For anyone downloading an older version, please note that you'll have to make consistent changes for the web page to refresh by itself. In other, words if you take a break from coding you'll probably have to refresh the page a couple times after making a change, usually I have to manually refresh 3 times before live server works.
Most helpful comment