-
-
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
Panic on proxy argument when running generate --watch
#381
Comments
I'm having the same issue even after updating to include the fix for #358.
|
Hi,
|
Hi, I can report the same issue. With just the commands:
After, doing what @eussam said ( I confirmed that the update of After running the This is annoying because, the hot-reload command from the doc does not work due to this issue. Edit 1: Edit 2: Edit 3: |
@eussam How can I help prepare a new production release? |
@drornir I'm not the right person to ask :), I just participated recently to #358 regarding the
but I have to spend some time on it. |
I think that what we need here is a decent integration test for the watch feature. The test needs to:
A more advanced version would test both POST and GET requests, and test that delays in starting up the main.go (i.e. having a time.Sleep in there) don't cause issues with the proxy, plus do other tests, like make lots of changes to files in sequence. With this integration style test in place, we should be able to reproduce issues more easily, and solve any weirdness. |
I added a test to the project that completes the assertions above in #441 Those changes have hit the main branch today. On the main issue, the So I think it's unlikely we'll see the the same behaviour. If folks can re-test with the latest version on main, that would be great. If you run If you run I'll close this issue in a week or so if there's no more to go on. |
Fix released in https://github.com/a-h/templ/releases/tag/v0.2.543 - upgrade with |
Hi @a-h - I seem to still be seeing a similar issue here on the following versions:
This is what I'm seeing:
Then it actually runs successfully, however I get this immediately after
The command I'm using is: (my server is running on 1323)
Apologies if this is not related, should I create a separate issue? |
I've completely rewritten the watch feature since the release you're using, but I haven't released it yet. If you could test by building the latest commit of the main branch from source, that would be great. I would like to have a GitHub workflow process that builds a pre-release version, but haven't set it up yet. I think it would help people to try out the upcoming versions. |
Thanks for the fast response @a-h - I upgraded using For the record, it works fine for everything else, and just manually reloading the page, but it doesn't auto reload. |
@a-h apologies if this isn't the correct forum for the question but I had another question regarding the proxy. If I run Is it expected that they differ, or am I expected to re-run |
It's not really the forum, no. This is a closed issue, and your issue isn't related, but... 😁 it's expected. If you run This is great locally, because you don't need to recompile your app to see changes to the HTML and text, but isn't at all what you want for an optimised production build because you don't want HTTP requests reading from the file system (terrible performance). Since 5821706 |
Appreciate the response, sorry for the off-topic question! |
Hi! I am running into a panic when trying to hotreload templ files using the
templ generate --watch
command. It looks like a failure when attempting to roundtrip the proxy request.Panic
Reproducible Setup
main.go
base.templ
command
templ generate --watch --proxy="http://localhost:8081"
The text was updated successfully, but these errors were encountered: