live-server
live-server copied to clipboard
Document requirement for body tag
Before submitting an issue, please, see https://github.com/tapio/live-server#troubleshooting
Issue description
live-server requires that body
tag be present in the HTML. This should be documented clearly. Granted most web pages will have body
tag. Still it will be a good idea to document it.
Software details
- Command line used for launching
live-server
: live-server - OS: Mac-OS
- Browser (if browser related): Chrome
- Node.js version: v11.5.0
-
live-server
version: 1.2.1
I ran into this! I was lazy, had an index.html
like
<!DOCTYPE html>
<p>Hello</p>
and so on, and live-reload mysteriously wasn't working.
In fact, rather than documenting the requirement (must have either body
or head
or svg
), it would be nice if there's an error message printed.
Actually, when I run live-server --verbose
such an error message is printed:
Failed to inject refresh script! Couldn't find any of the tags [ /<\/body>/i, /<\/svg>/, /<\/head>/i ] from /path/to/bad.html
so it would be nice if this (important!) error message is printed even without --verbose
.
This PR might help: https://github.com/tapio/live-server/pull/217