Franklin `serve()` issue on WSL

Hello,

I am using Ubuntu on Windows Subsystem for Linux 1 (WSL1). I’m also using the Windows Terminal if that matters. I’ve followed the initial steps to create a sandbox website here. Everything is fine until I do serve(). It appears to be successful and gives me the url to view the website but a few seconds later the REPL spits out the following error.

I can view the web page but any updates I make to the index.md do not seem to propagate to the live view even with page refreshing.

If it matters, I also have Live Server installed in VSCode and it works as expected when using it with html files.

I’m not sure what to make of the error. Any thoughts or suggestions?

┌ LogLevel(1999): handle_connection handler error
│   exception =
│    IOError: write: broken pipe (EPIPE)
│    Stacktrace:
│      [1] uv_write(s::Sockets.TCPSocket, p::Ptr{UInt8}, n::UInt64)
│        @ Base ./stream.jl:1061
│      [2] unsafe_write(s::Sockets.TCPSocket, p::Ptr{UInt8}, n::UInt64)
│        @ Base ./stream.jl:1115
│      [3] unsafe_write(c::HTTP.ConnectionPool.Connection, p::Ptr{UInt8}, n::UInt64)
│        @ HTTP.ConnectionPool ~/.julia/packages/HTTP/VAOuj/src/ConnectionPool.jl:105
│      [4] unsafe_write(http::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Connection}, p::Ptr{UInt8},
 n::UInt64)
│        @ HTTP.Streams ~/.julia/packages/HTTP/VAOuj/src/Streams.jl:94
│      [5] unsafe_write
│        @ ./io.jl:683 [inlined]
│      [6] write(s::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Connection}, a::Vector{UInt8})
│        @ Base ./io.jl:706
│      [7] (::HTTP.Handlers.var"#1#2"{LiveServer.var"#16#20"{typeof(identity), Bool, Bool, LiveServer.SimpleWatcher}})(stream::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Connection})
│        @ HTTP.Handlers ~/.julia/packages/HTTP/VAOuj/src/Handlers.jl:61
│      [8] (::LiveServer.var"#25#26"{HTTP.Handlers.var"#1#2"{LiveServer.var"#16#20"{typeof(identity), Bool, Bool, LiveServer.SimpleWatcher}}})(http::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Connection})
│        @ LiveServer ~/.julia/packages/LiveServer/cZ2Z3/src/server.jl:606
│      [9] #invokelatest#2
│        @ ./essentials.jl:729 [inlined]
│     [10] invokelatest
│        @ ./essentials.jl:726 [inlined]
│     [11] handle_connection(f::Function, c::HTTP.ConnectionPool.Connection, listener::HTTP.Servers.Listener{Nothing, Sockets.TCPServer}, readtimeout::Int64, access_log::Nothing)
│        @ HTTP.Servers ~/.julia/packages/HTTP/VAOuj/src/Servers.jl:442
│     [12] (::HTTP.Servers.var"#16#17"{LiveServer.var"#25#26"{HTTP.Handlers.var"#1#2"{LiveServer.var"#16#20"{typeof(identity), Bool, Bool, LiveServer.SimpleWatcher}}}, HTTP.Servers.Listener{Nothing, Sockets.TCPServer}, Set{HTTP.ConnectionPool.Connection}, Int64, Nothing, Base.Semaphore, HTTP.ConnectionPool.Connection})()
│        @ HTTP.Servers ./task.jl:484
└ @ HTTP.Servers ~/.julia/packages/HTTP/VAOuj/src/Servers.jl:456

Hello, hmm that’s a shame.

The problem is with LiveServer here. It’s somehow failing to send a “ping” to your browser to do the refreshes (so what you describe makes sense).
Could you please:

  1. check that you have the latest version of LiveServer (1.0.3)
  2. open an issue in LiveServer specifying your OS, Julia version and what happens when you do:
    a. create a folder with a dummy index.html (with super basic HTML)
    b. in Julia, activate that folder, add LiveServer (should be 1.0.3)
    c. using LiveServer; serve(launch_browser=true) (page with dummy HTML should show, from what you describe that part should be fine)
    d. edit the index.html adding some simple content, save, check that the page gets updated in the browser, if it does, do it a few times just to check
    e. if (d) fails, try again with another browser (e.g. Firefox vs Edge) to see if that changes anything

If you could report all this in an issue in LiveServer.jl that will be super useful to try to figure out if the issue is with Windows, the browser, LiveServer, HTTP or something else. Thanks!