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

docs: clarify when live reload might fail due to middleware implementation #1048

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zachczx
Copy link

@zachczx zachczx commented Jan 14, 2025

Hello, I didn't realize I haven't been benefiting from live reload despite setting it up in my Makefile. After digging about today it turns out my use of https://github.com/go-swiss/compress Brotli middleware was causing issues, and that is not the case when using other gzip or middleware implementation. Without diving deeper, it seems weird that this compression middleware creates a problem, because it is using the same Brotli package as templ's under the hood for proxy.go. Probably a case of implementation where compressed handler got written to ResponseWriter and flushed, so there was nothing to inspect when templ got its chance.

Regardless, I think it'd be a good idea to clarify upfront that the Content-Type is important for the JS script insertion and hint at middleware implementation being an issue.

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.

1 participant