Error in `ensure_connection(...)`
Opened this issue · 1 comments
frankier commented
When we try a websocket write, ensure_connection(...)
is called, which calls setup_connection()
without an argument
Bonito.jl/js_dependencies/Websocket.js
Line 22 in 1a6083e
However it looks like the config
argument is actually required
Bonito.jl/js_dependencies/Websocket.js
Line 159 in 1a6083e
frankier commented
Okay I managed to trigger this like so:
using HTTP
using Bonito: App
using Bonito.DOM
using Makie
#using WGLMakie
function main()
# start a blocking server
HTTP.listen() do http::HTTP.Stream
HTTP.setstatus(http, 200)
HTTP.startwrite(http)
if http.message.target == "/fragment"
app = App() do
DOM.div("hi!")
end
io = IOBuffer()
show(io, "text/html", app)
body = take!(io)
write(http, body)
else
write(http, "<html><body>")
write(http, "<script src=\"https://unpkg.com/htmx.org@2.0.2\"></script>")
write(http, "<h1>fragment insertion</h1>")
write(http, "<button hx-get=\"/fragment\" hx-target=\"#results\">Click Me</button>")
write(http, "<div id=\"results\"></div>")
write(http, "</body></html>")
end
end
end
if abspath(PROGRAM_FILE) == @__FILE__
main()
end
Related: MakieOrg/Makie.jl#4343 (comment)