Two latent bugs surfaced building a real project (mathias/cad-atlas) from this template, 2026-07-19. Both bite every child repo on first build.
1. templ version skew (build-breaking)
go.mod pins github.com/a-h/templ v0.2.778, but CI installs templ@latest (currently v0.3.x). The v0.3 generator emits templruntime.WriteString, which does not exist in the v0.2.778 runtime:
So task check / go build fails on a freshly generated repo.
Fix: pin the generator and runtime to the same minor. Either bump go.mod to the current templ (go get -u github.com/a-h/templ@latest + regenerate) and pin CI to a matching templ@vX.Y.Z, or hold both at v0.2.778. Don't let CI float to @latest against a pinned runtime.
2. .gitignore pattern doesn't match templ output
Pattern is *.templ.go (dot). templ actually emits *_templ.go (underscore). Generated files are therefore not ignored and leak into git add -A.
Fix: change the pattern to *_templ.go.
Repro
# create from template, then:
go install github.com/a-h/templ/cmd/templ@latest
templ generate && go build ./... # → undefined: templruntime.WriteString
git add -A && git status # → index_templ.go / layout_templ.go staged (should be ignored)
Related brain note: wiki/homelab/decisions/cad-atlas-audit-chain-is-viz-data.md (template-go-web footguns section). Also note the known no-go.sum-shipped behavior (child runs go mod tidy).
Two latent bugs surfaced building a real project (`mathias/cad-atlas`) from this template, 2026-07-19. Both bite every child repo on first build.
## 1. templ version skew (build-breaking)
`go.mod` pins `github.com/a-h/templ v0.2.778`, but CI installs `templ@latest` (currently v0.3.x). The v0.3 generator emits `templruntime.WriteString`, which does not exist in the v0.2.778 runtime:
```
internal/web/index_templ.go:44:38: undefined: templruntime.WriteString
```
So `task check` / `go build` fails on a freshly generated repo.
**Fix:** pin the generator and runtime to the same minor. Either bump `go.mod` to the current templ (`go get -u github.com/a-h/templ@latest` + regenerate) and pin CI to a matching `templ@vX.Y.Z`, or hold both at v0.2.778. Don't let CI float to `@latest` against a pinned runtime.
## 2. `.gitignore` pattern doesn't match templ output
Pattern is `*.templ.go` (dot). templ actually emits `*_templ.go` (underscore). Generated files are therefore **not** ignored and leak into `git add -A`.
**Fix:** change the pattern to `*_templ.go`.
## Repro
```bash
# create from template, then:
go install github.com/a-h/templ/cmd/templ@latest
templ generate && go build ./... # → undefined: templruntime.WriteString
git add -A && git status # → index_templ.go / layout_templ.go staged (should be ignored)
```
Related brain note: `wiki/homelab/decisions/cad-atlas-audit-chain-is-viz-data.md` (template-go-web footguns section). Also note the known no-`go.sum`-shipped behavior (child runs `go mod tidy`).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Two latent bugs surfaced building a real project (
mathias/cad-atlas) from this template, 2026-07-19. Both bite every child repo on first build.1. templ version skew (build-breaking)
go.modpinsgithub.com/a-h/templ v0.2.778, but CI installstempl@latest(currently v0.3.x). The v0.3 generator emitstemplruntime.WriteString, which does not exist in the v0.2.778 runtime:So
task check/go buildfails on a freshly generated repo.Fix: pin the generator and runtime to the same minor. Either bump
go.modto the current templ (go get -u github.com/a-h/templ@latest+ regenerate) and pin CI to a matchingtempl@vX.Y.Z, or hold both at v0.2.778. Don't let CI float to@latestagainst a pinned runtime.2.
.gitignorepattern doesn't match templ outputPattern is
*.templ.go(dot). templ actually emits*_templ.go(underscore). Generated files are therefore not ignored and leak intogit add -A.Fix: change the pattern to
*_templ.go.Repro
Related brain note:
wiki/homelab/decisions/cad-atlas-audit-chain-is-viz-data.md(template-go-web footguns section). Also note the known no-go.sum-shipped behavior (child runsgo mod tidy).