Since eleventy --serve continues to attempt to generate output and does not error-out on failures, I'm often confused by how making changes doesn't seem to reflect on the output only to realise that an error was encountered long back but the server continued to serve an old copy of the output. I use hotel, which will display 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.
Hm, I can see your point …
But a crash would make you restart eleventy by hand, wouldn't it?
@Ryuno-Ki better than staying in the illusion that my code's output isn't updating for some mysterious mistake of mine :)
Hm, I'm biased.
Yeah, I ran into the same situation (my broken template didn't get updated because of an error), but I'd rather expect to keep eleventy running in watch mode, so I could fix it without switching to a terminal again and again.
For me, the issue lies into _too much logging after an error_.
Maybe there would be a way to fold them („N lines suppressed”) without hiding _all_ output?
You can opt into only a few of Eleventy's modules for debug messages.
https://www.11ty.io/docs/debugging/
I often run locally:
DEBUG=Eleventy:TemplateContent,Eleventy:EleventyErrorHandler npx eleventy --serve
I agree I'd rather let Eleventy keep running during these errors, since I often fix em pretty quickly. But it would certainly be useful to have some kind of notifier either in the browser or OS notification or even a terminal chime of sorts when an error pops up so you know it happened.
Like https://github.com/alextucker/grunt-growl ?
Maybe @zachleat can steal from there?
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:
File changed: _includes/components/header/link-level-1.ejs
Problem writing Eleventy templates: (more in DEBUG output)
> Having trouble rendering ejs template ./style-guide/header.ejs (TemplateContentRenderError)
> ./style-guide/header.ejs:2
1|
>> 2| <%- include('../_includes/components/header/index'); %>
…
Processed 0 files in 0.03 seconds
Watching…
[Browsersync] Reloading Browsers...
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:

This repository is now using lodash style issue management for enhancements. This means enhancement issues will now be closed instead of leaving them open.
View the enhancement backlog here. Don’t forget to upvote the top comment with 👍!
I wonder how much effort it is to integrate a tool like node-notifier to throw an OS notification on error?
I do not wish for a development tool to trigger any kind of notification, especially not on the OS level.
We could make it configurable and off by default?
It could be a semi-decent stopgap…?
I've run across this too a few times - eleventy has crashed, but everything seems normal.
I don't much mind the solution, but agree _something_ would be good. Notifications / stop serving / serve error, etc.
Hey folks, here's an (incomplete) PR to get the error overlay into the core. Feedback on some decisions, as well as advice on how/what to test would be much appreciated.
Most helpful comment
https://twitter.com/stevenpetryk/status/1246614147749384195