eleventy: Error-out on failure with `eleventy --serve`
Since eleventy --serve
continues to attempt to generate output and does not error-out on failures, I’m often confused by how my changes don’t seem to reflect in the output. I use hotel, which displays a clear error message in the browser when attempting to access the site after the server crashes with an non-zero error code.
Having eleventy --serve
error-out on failure (at least by default) would be awesome.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 5
- Comments: 17 (10 by maintainers)
Commits related to this issue
- Add error overlay to the core Closes #525 — committed to stevenpetryk/eleventy by stevenpetryk 4 years ago
Here is @stowball’s comment from #542 (hopefully we can combine his issue with this one):
Currently, unless you’re watching the terminal output on every save, you have no idea if you’ve accidentally introduced a syntax error to your templates because for all intents and purposes, the browser reloads and appears to have worked. Unfortunately, it just reloads with the last good, cached version, which then causes extra frustration as you try to debug new code which you think should be rendered, but isn’t.
Here’s an example of what happens on an “unsuccessful” save:
which, apart from the number of files processed, is essentially the same as what happens on a successful save.
What I’d like to see is something like what Create React App does, where the error is logged to both the terminal and the browser, like this:
https://twitter.com/stevenpetryk/status/1246614147749384195
I wonder how much effort it is to integrate a tool like node-notifier to throw an OS notification on error?
Oh I didn’t even notice it was broken. Lol. I’ll see if I can fix it soonish.