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
I have only begun using templ today, so apologies if it is simply skill issues.
I am running minikube in docker on Ubuntu, building the images using skaffold+ko.
When I make a change to a templ file without the watch command, nothing builds, this is expected because skaffold is configured to not watch templ files.
When templ generate --watch is running, a change to a templ file changes the go file and triggers a build of the http server that is serving the templ component.
When port-forwarding the load balancer service for the http server and attempting to access it locally I see the following error in my browser:
templ: failed to render template
When executing the templ generate command, the same behavior results in the Hello World HTML being properly displayed in the browser.
The text was updated successfully, but these errors were encountered:
Hi @Dmarcotrigiano - at the moment, that's expected behaviour. In --watch mode, the code that's generated by templ looks at a file on disk instead, to reduce the number of times that your program needs to be recompiled.
However, in your case, it sounds like you're rebuilding your program and creating a new Docker container for each change to a template.
You're not the first person to be surprised by the behaviour, so I think we need to change it as per #700 (comment)
It's a fairly straightforward change, just needs a little thought, and some testing of the performance implications.
That is correct, and it's blazingly fast! Making a change to a template then building an image, then rolling out a deployment takes like 2 seconds on my machine.
This is what I've done to circumvent the caching behavior
I have only begun using templ today, so apologies if it is simply skill issues.
I am running minikube in docker on Ubuntu, building the images using skaffold+ko.
When I make a change to a templ file without the watch command, nothing builds, this is expected because skaffold is configured to not watch templ files.
When
templ generate --watch
is running, a change to a templ file changes the go file and triggers a build of the http server that is serving the templ component.When port-forwarding the load balancer service for the http server and attempting to access it locally I see the following error in my browser:
When executing the
templ generate
command, the same behavior results in theHello World
HTML being properly displayed in the browser.The text was updated successfully, but these errors were encountered: