ritwickdey / live-server-web-extension

It makes your existing server live. This is a browser extension that helps you to live reload feature for dynamic content (PHP, Node.js, ASP.NET -- Whatever, it doesn't matter)
https://chrome.google.com/webstore/detail/live-server-web-extension/fiegdmejfepffgpnejdinekhfieaogmj/
MIT License
801 stars 334 forks source link

Live Reload is not possible without body or head tag #13

Open aws0002 opened 6 years ago

aws0002 commented 6 years ago

I get this error 'Live Reload is not possible without body or head tag' when I start the server, however, I use the standard emmet html5 boilerplate using '! tab'. This boilerplate has both a head and body tag but the error is still appearing.

Mikael-Sundstrom commented 6 years ago

Hi, what is your error message?

aws0002 commented 6 years ago

Live Reload is not possible without body or head tag

Mikael-Sundstrom commented 6 years ago

Have you set up the settings correctly?

What technology are you using, i.e. PHP, .Net, NodeJS or other. And what is your settings in the web extension, or are you using proxy setup?

mikecastrodemaria commented 6 years ago

Hi, Same problem using PHP in my case + php file not display, but forced to be downloaded. Any setting missing ? Thanks

Mikael-Sundstrom commented 6 years ago

Do you run a server like XAMPP or WAMP?

VS Code Extension Lever Server will not host neither the Node JS Framework, PHP or .Net. The VS code extension without the web extension starts a simpler server for your static files. It works differently with server side, because it is much more complex. When you use this add-on to PHP, you need to run your own server locally such as XAMPP or the like. When you click the Go Live button, you will get the "auto refresh" feature when you enter your settings. That's what this add-on does.

Have I understood you right that you do not use a local server? I can guide you through the steps if you want.

dorg-charlywelch commented 6 years ago

Hi there -- I'm experiencing the same issue using AngularJS (yes, old). There are head and body tags in index, but not in the templates... I don't see any settings to fix this. Any help would be appreciated. Thanks!

kevscript commented 6 years ago

Hi, having the same exact problem. 3 simple files, .html .css and .js, body and head present in my html.

Mikael-Sundstrom commented 6 years ago

Please describe what you are trying to do, and what step you have done. It's hard to help you otherwise. And have you followed the setup guide at Setup.md?

dorg-charlywelch commented 6 years ago

I have followed the setup guide up to setting up a server - I've never had the need to do that before when when working on a standalone front end, so I'm confused as to why this new error is coming up. It also seems I'm not alone in this - looks like a number of folks are encountering the same issue. So, I have a handful of html files, a head and body tag, and an app.js, all for an Angular class on Udemy. At each change, the attached text box refreshes itself. Thanks for your help!

On Tue, Aug 7, 2018 at 7:35 AM, Mikael Sundström notifications@github.com wrote:

Please describe what you are trying to do, and what step you have done. It's hard to help you otherwise. And have you followed the setup guide at Setup.md https://github.com/ritwickdey/live-server-web-extension/blob/master/docs/Setup.md ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ritwickdey/live-server-web-extension/issues/13#issuecomment-411078841, or mute the thread https://github.com/notifications/unsubscribe-auth/AnID4s6GRG7dZgFMXxUhYQ2O5Y0xW1z9ks5uOaW0gaJpZM4Tbl63 .

--

CHARLY WELCH

*Software Engineer, *DiscoverOrg

P: 503.442.5929

charly.welch@discoverorg.com

Mikael-Sundstrom commented 6 years ago

Hi

I don't think you need this browser add-on for angular, because it's a client app that you run with CLI while you're developing. Do you use nodejs, php or any similar server programming language?

Could you try to add this to settings.json to see if it works? (wait 300ms before liveserver reload the page)

"liveServer.settings.wait": 200

Your right, we have to solve the issue and clarify it in the FAQ, as it seems to be a common problem.

andregarcia809 commented 5 years ago

I was having the same error, "cant load server without head or body tag", tried changing the wait settings from 100ms to 300ms and its working again. Thanks.

irakliykech commented 5 years ago

I have same problem. When I add some tags in head or body elements in html-document, VScode warning Live Reload is not possible without body or head tag and instead of my project I see in browser white background. I have tried reinstal liveserver and VSCode but it did not help. vscode-error vscode-error_second

Taariqq commented 5 years ago

Hi

I don't think you need this browser add-on for angular, because it's a client app that you run with CLI while you're developing. Do you use nodejs, php or any similar server programming language?

Could you try to add this to settings.json to see if it works? (wait 300ms before liveserver reload the page)

"liveServer.settings.wait": 200

Your right, we have to solve the issue and clarify it in the FAQ, as it seems to be a common problem.

Similar problem here. I have a vagrant setup with 'Actual Server Address' as "http://192.168.10.10/wordpress/wp-content/themes/GTCoding/"

If I open an html file, it works fine but if I try any .php file it gives me the "Live Reload is not possible w/o body or head tag" and in the browser it just gives me an option to download the .php file or open with Brackets!!

jenstornell commented 5 years ago

I also had that message. https://github.com/ritwickdey/live-server-web-extension/issues/22#issuecomment-497339985

I needed to add a dummy html file containing a correct header and start the server from there, just to get the server started. Then change the url to the php file.

mdsams commented 4 years ago

I get this error 'Live Reload is not possible without body or head tag' when I start the server. I am using node.js

KentHefley commented 3 years ago

I am getting this error. I am using live sass compiler. Firefox is my default browser. It only happens when I edit the index.html page. The page also doesn't reload properly.

ed77777 commented 2 years ago

I had the same problem when I was doing @import url(test.css), but I had a "test" file without the "css" extension