Skip to content
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

Error-out on failure with `eleventy --serve` #525

Open
shreyasminocha opened this issue May 8, 2019 · 5 comments

Comments

Projects
None yet
3 participants
@shreyasminocha
Copy link

commented May 8, 2019

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.

@Ryuno-Ki

This comment has been minimized.

Copy link

commented May 8, 2019

Hm, I can see your point …
But a crash would make you restart eleventy by hand, wouldn't it?

@shreyasminocha

This comment has been minimized.

Copy link
Author

commented May 9, 2019

@Ryuno-Ki better than staying in the illusion that my code's output isn't updating for some mysterious mistake of mine :)

@Ryuno-Ki

This comment has been minimized.

Copy link

commented May 9, 2019

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?

@jevets

This comment has been minimized.

Copy link

commented May 13, 2019

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.

@Ryuno-Ki

This comment has been minimized.

Copy link

commented May 13, 2019

Like https://github.com/alextucker/grunt-growl ?

Maybe @zachleat can steal from there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.