-
Notifications
You must be signed in to change notification settings - Fork 61
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
SSE Extension: The examples given in the documentation does not work #137
Comments
Hey, what version of htmx are you using ? I'm asking as you use the legacy So the issue could simply be that you are using htmx 1 here, let me know! |
@Telroshan I am using htmx 2.0 extension (as well as htmx 2.0) from cloudflare CDN and facing the same issue @elieobeid7 Try starlette's SSE library instead of returning EventSource from fastapi |
@Telroshan I'm using
@XChikuX I'm already using starlette's SSE library instead, yes, already done that, because as I stated the fastapi eventsource library won't work with HTMX, HTMX would complain about text encoding or something, forgot the error. |
This should be version 2: |
Ok well noted will update but it seems that the issue still exists |
Yup. Docs are wrong |
Also @Telroshan please whenever possible upload the latest HTMX on JSDeliver, this is the latest version now on there |
Aha Thanks for pointing this out |
@XChikuX if |
Hey, well it's weird because we have an exact test case for this example, see our test suite that tests the following setup: <div hx-ext="sse" sse-connect="/event_stream">
<div id="d1" sse-swap="e1"></div>
<div id="d2" sse-swap="e2"></div>
</div> Names differ but the setup looks identical, and works. There might be something wrong in your configuration, or your server might be handling SSE incorrectly. |
The examples given in the documentation does not work
Example
Real world code that does not work, nothing gets swapped
html
Python, fastapi
The following works fine
HTML
Python, FastApi
Note regarding FastAPI
I'm using
I couldn't get FastAPI built in library to work, I mean this
HTMX would always throw errors if I use that one, about the response not being text or whatnot, forgot the error, it's been about 3 weeks when I tried it.
The text was updated successfully, but these errors were encountered: