You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The solution is to update the generator to add a fake import to the generated code, e.g. var _ = templruntime.GeneratedTemplate that way, even if the code doesn't use the import explicitly, it won't cause this error.
Alternatives involve checking that the imports are used by the generated code, which would add complexity for little benefit.
joerdav
changed the title
"github.com/a-h/templ/runtime" imported as templruntime and not used
bug: "github.com/a-h/templ/runtime" imported as templruntime and not used
Jul 8, 2024
I have a small templ file that only includes scripts, after upgrading to templ v0.2.747 today I'm getting this error:
You can reproduce it by running
templ generate
on this:The text was updated successfully, but these errors were encountered: