-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Live Reload is not possible as body or head tag or defined tag is missing in HTML" warning shows on every reload #22
Comments
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. |
|
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. |
Same issue here. As per above. |
|
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. |
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 |
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̵.̵ |
it happened to me too and it was very irritating so i turned it off from settings.json "liveServer.settings.donotShowInfoMsg": true, |
How did you get this working? It would appear that this takes |
i think this did it for me |
@mrmatata That gets rid of the message but auto reloading still doesn't work unless there is |
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. |
Yep - had stopped working after I started creating the bulk of my structure ahead of time in the terminal. Fixed by deleting .html files and using the New File GUI in VS Code to recreate and paste over code. |
the same to me! |
I find that I get this erroneous message if I have an invalid import in a CSS file that is imported by the CSS file imported in my HTML. In particular, a line was trying to import a folder, and one was trying to import by name without
|
why the {% load static %} tag |
Idk guys but I got this error too. |
helloo, i received this error message today every time i reload my live server. i have both head tags and body tags so this issue is still happening today it seems.-. |
Hello, I also had the error, but I think I solved it, simply add the tag and in the extension settings, look for Live Server>Settings: Custom Browser, in my case select microsoft edge, because it is the that I usually use to observe the changes, and finally restart VS code, with that I solve the problem, I hope it works for you |
I had this problem randomly appeared after 1 year. I finally solved it, it was and @import row in the style.css file. This was the specific row: |
It is because you have made a media query on your file and your display screen/window is in that size, and since you don't have a body or head in your media query----That's why!!! Had a similar case, try resizing your window, save and see. |
Same problem as above right now, my structure has head and body tag, so I don't know what it refers too. Any ideas? |
I had this problem, too. I opened my .scss file, saved it and my extension recompiled the CSS. The pop-up is now gone. |
Make sure that your HTML tab is active, not the CSS or JS! |
Same issue as above. I previously never had this issue. It's a simple html file: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Project</title>
</head>
<body>
hello
</body>
</html> It's a syntactically valid HTML file with head and body tag, and it serves other html files in the directory fine. The HTML tab is active and works when I open it without live server. |
@justingolden21 it might be the utf-16 LE encoding issue. I created the file using ps7 prompt using Out-File cmdlet. Never had this issue crating empty file from command prompt though. Check these answer by @neospud1
|
I had the same problem with live-server. I'll attach a screenshot of the folder structure. Good CaseBad CaseAdditionally, this error appears to appear if you turn on the live server on a drive other than the primary drive, such as the D drive instead of the C drive! Move the file and give it a try! |
This bug was not fixed yet? Removing this line the warning do not appear anymmore. |
I had the same problem with a very simple html and the reason was the encoding. Thanks @WeaponXiii !!
|
I'm having this same issue. It's not encoding. The HTML file is in the root of the project and is named Index.html. I have the index.html file selected when clicking "Go Live". It has a head and body tag. The only thing I can think of is that I do have an HTML file in a folder called "templates" which doesn't have a head or body, and it is being loaded by the "loadMenu" function. But I still get the error when ONLY index.html is open in the editor. And live update is working. Here is the full index.html
|
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.
The text was updated successfully, but these errors were encountered: