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

Dev mode: nicer HTML injection of error message / live reload #140

Merged
merged 3 commits into from
May 29, 2024

Conversation

sam-shift72
Copy link
Contributor

This improves the way that build error notifications and the live reload markup is injected.

Previously, if there was a build error anywhere on the site, the errors got prepended to the HTML response. This resulted in invalid markup and made the site completely unusable in dev mode.

These build errors sometimes happened for relatively minor things, like invalid meta coming back for some items, and may not have a significant impact on the site in a prod build.

Instead, this now looks for the tag and injects any HTML there.

Rather than spamming all the errors, it just sticks in a nice notification toast that goes away after several seconds.

image

This improves the way that build error notifications and the live reload
markup is injected.

Previously, if there was a build error anywhere on the site, the errors
got prepended to the HTML response. This resulted in invalid markup and
made the site completely unusable in dev mode.

These build errors sometimes happened for relatively minor things, like
invalid meta coming back for some items, and may not have a significant
impact on the site in a prod build.

Instead, this now looks for the </body> tag and injects any HTML there.

Rather than spamming all the errors, it just sticks in a nice
notification toast that goes away after several seconds.
@sam-shift72 sam-shift72 requested a review from PeculiarGoat May 27, 2024 04:55
Copy link
Contributor

@PeculiarGoat PeculiarGoat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sam-shift72 sam-shift72 merged commit 627eb43 into master May 29, 2024
2 checks passed
@sam-shift72 sam-shift72 deleted the AB#12429-fix-errors-breaking-html branch May 29, 2024 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants