-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
cmd: templ --watch does not close port on SIGINT #487
Comments
Would you mind giving the main branch a try please? I completely rewrote the whole of the |
Coming from #493 TLDR: Does not work. Spawns a new cmd after closing templ. claimed evidence is changed id of go process after ctrl+z It seems that the templ process on ctrl+c is closing itself and the go process it started however after that it create a new go process? I say this based on the fact a the pgid and id of the go process has changed after I pressed ctrl+c to terminate. aside: I ran into this issue when I was trying to run templ using custom hotreload go file and ran into this issue on linux. for some reason I can easily kill the command in windows using my custom hotreload |
Hi @Huzaifa-MS, from the logs you posted, it looks like you're not using the latest version of the CLI on the main branch. Would you be able to test it with the main branch instead please? I've rewritten the whole of the --watch mode code from scratch since the version you're using. |
I will try. Sorry I thought doing a go get to main would get the latest |
It seems the latest version of templ requires a newer version of go since my version does not have slog. Will try this later today hopefully |
It is working correctly now. Great work! :) Steps:
Also how would I fix the generator warning? or will updating to next release fix itself |
It should fix itself in the next release. With Go, when you do If you run You don't need Go 1.21 installed to run the CLI, if you use a binary that we release, but obviously, if you build from source, you'll need the later Go version. The strategy we have is to use the latest Go version to build the CLI and produce binaries, but the runtime supports the current Go version - 2 releases. Go 1.22 was released today, so we're now free to start using Go 1.20 features in the runtime. |
Thank you for helping me understand this better : ) |
@Murderlon - the latest release of templ should have fixed this issue. If not, please feel free to reopen, and I'll start investigation again, but here's a demo of it working fine, with the example sorted_small.mp4 |
Sorry I didn't get around to testing this earlier myself. Thanks for the fix! |
Hi, I love the effort in bringing a watcher to
templ
! Unfortunately, the port of my server is never closed.I'm running a practically barebones
chi
server, nothing special going on there.☝️ notice that the program stopped but it logged a line where my cursor is
Running it again:
The text was updated successfully, but these errors were encountered: