Skip to content
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

Error in ensure_connection(...) #245

Open
frankier opened this issue Aug 10, 2024 · 1 comment
Open

Error in ensure_connection(...) #245

frankier opened this issue Aug 10, 2024 · 1 comment

Comments

@frankier
Copy link
Contributor

When we try a websocket write, ensure_connection(...) is called, which calls setup_connection() without an argument

setup_connection();

However it looks like the config argument is actually required

const { session_id, proxy_url } = config;

@frankier
Copy link
Contributor Author

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/[email protected]\"></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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant