-
-
Notifications
You must be signed in to change notification settings - Fork 349
Description
Before you begin
Please make sure you're using the latest version of the templ CLI (go install github.com/a-h/templ/cmd/templ@latest), and have upgraded your project to use the latest version of the templ runtime (go get -u github.com/a-h/templ@latest)
Describe the bug
TEMPL_DEV_MODE=true templ generate -v --watch --cmd "go run ."
Starting from v0.3.887 (CLI and in go.mod) and up to the latest version, Templ reruns the application when text (not Go code) is modified inside a *.templ file.
I've confirmed this doesn't happen in v0.3.865 and earlier.
To Reproduce
A small, self-contained, complete reproduction, uploaded to a GitHub repo, containing the minimum amount of files required to reproduce the behaviour, along with a list of commands that need to be run. Keep it simple.
Repo: https://github.com/BookOfCooks/templ_live_reload_bug
Just run the first command in the README, then make a change to the text in the templates/home.templ file. You'll observe that the application is rerun.
Expected behavior
A clear and concise description of what you expected to happen.
When I make a simple TEXT change in the *.templ file, I expect to reload the page in the browser and see the change, without seeing "Served application on localhost:8080" in the logs.
This should happen, according to the docs.
Screenshots
If applicable, add screenshots or screen captures to help explain your problem.
Logs
If the issue is related to IDE support, run through the LSP troubleshooting section at https://templ.guide/developer-tools/ide-support/#troubleshooting-1 and include logs from templ
templ info output
Run templ info and include the output.
(✓) os [ goos=linux goarch=amd64 ]
(✓) go [ location=/usr/local/go/bin/go version=go version go1.24.5 linux/amd64 ]
(✓) gopls [ location=/home/bookofcooks/go/bin/gopls version=golang.org/x/tools/gopls v0.19.1 ]
(✓) templ [ location=/home/bookofcooks/go/bin/templ version=v0.3.920 ]
Desktop (please complete the following information):
- OS: [e.g. MacOS, Linux, Windows, WSL]: WSL
- templ CLI version (
templ version): v0.3.920 - Go version (
go version): go version go1.24.5 linux/amd64 goplsversion (gopls version): golang.org/x/tools/gopls v0.19.1
Additional context
Add any other context about the problem here.