Closed talkingtoaj closed 1 month ago
If you update FastHTML to the the latest version currently v0.6.8. Do you still have that issue?
@talkingtoaj I can't replicate your error. Here's my sample code, which uses your example as a base. If you can provide a reproducable error let me know with a flag to @pydanny
and I'll reopen this ticket.
from fasthtml.common import *
css = Style(':root {--pico-font-size:90%,--pico-font-family: Pacifico, cursive;}')
sse = Script(src="https://unpkg.com/htmx-ext-sse@2.2.1/sse.js")
hdrs = (css, sse)
app, rt = fast_app(hdrs=hdrs)
setup_toasts(app)
@rt
def index(sess):
return Titled('Hello, world',
P(A(href='/toast-test')('Toast test'))
)
@rt('/toast-test')
def get(sess):
add_toast(sess, 'This is a toast')
return Redirect('/')
serve()
Gives compile time error of
I've tried diagnosing it unsuccessfully.
Removing headers doesn't help.