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

"'Closewrite' not defined" Error when using Franklin.serve() #1034

Closed
SSShupe opened this issue Jul 6, 2023 · 4 comments
Closed

"'Closewrite' not defined" Error when using Franklin.serve() #1034

SSShupe opened this issue Jul 6, 2023 · 4 comments

Comments

@SSShupe
Copy link

SSShupe commented Jul 6, 2023

I am using Franklin with Julia 1.9.2 on Debian. When I follow the instructions on the main Franklin site, the site files are generated, but when I open a browser on localhost:8000, nothing shows, and I get the following error:

julia> using Franklin

julia> newsite("SSS"; template="vela")
✓ Website folder generated at "SSS" (now the current directory).
→ Use serve() from Franklin to see the website in your browser.

julia> serve()
  Activating project at `~/Franklin/SSS`
→ Initial full pass...
→ evaluating code [ex3] in (menu1.md)                                                                                                                                                  → Starting the server...
✓ LiveServer listening on http://localhost:8000/ ...
  (use CTRL+C to shut down)
WARNING: both IOExtras and Base export "closewrite"; uses of it in module ConnectionPool must be qualified
WARNING: both IOExtras and Base export "closewrite"; uses of it in module Servers must be qualified
┌ Error: error handling request
│   exception =
│    UndefVarError: `closewrite` not defined
│    Stacktrace:
│     [1] macro expansion
│       @ ~/.julia/packages/HTTP/RwjlP/src/Servers.jl:403 [inlined]
│     [2] (::HTTP.Servers.var"#13#14"{LiveServer.var"#16#21"{HTTP.Handlers.RequestHandlerFunction{LiveServer.var"#14#19"{typeof(identity), Bool, Bool, LiveServer.SimpleWatcher}}}, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}, HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}})()
│       @ HTTP.Servers ./task.jl:514
└ @ HTTP.Servers ~/.julia/packages/HTTP/RwjlP/src/Servers.jl:405

(The error repeats multiple times, but it's always the same.) I've used Franklin before and never seen this error before. I'm not sure if it's a Franklin error or something screwy with the HTTP package.

Any help would be appreciated. Thanks.

@tlienart
Copy link
Owner

tlienart commented Jul 7, 2023

It's something screwy with the HTTP package (it could be better handled at the LiveServer level which I also maintain, but for this I need to understand the issue at HTTP level and that code base is too obscure for me)

More importantly though: usually these errors show up but don't harm the actual functioning of serve ie content is properly generated and available in the browser, is that the case for you too? Or is it crashing the server?

@SSShupe
Copy link
Author

SSShupe commented Jul 7, 2023

The error does affect the output. When I open localhost:8000 with the browser I get nothing (opening the browser also seems to be what triggers the error). It doesn't seem to actually crash the server, though; I have to use Ctrl-C to terminate it.

I'm going to nose around and see if I can find a workaround.

@SSShupe
Copy link
Author

SSShupe commented Jul 7, 2023

Well, I'm not sure why, but everything is working now. One of these mysteries of computing. Perhaps a bad sprite had infested my computer last time. I'll let you know if the problem reappears.

@tlienart
Copy link
Owner

tlienart commented Jul 7, 2023

So FYI I'm aware of this kind of problem popping up when eg:

  1. Start the server and go to a browser tab
  2. Kill it
  3. Restart it and refresh a pre-existing browser tab

This will typically show errors probably because the socket was dropped and then reopened (or something magical of the sort)

Same kind of stuff can happen when using several browsers and using different tabs and, again, refreshing stuff around the time a server is restarted.

If you happen to recreate the problem and got to it via another route, let me know, it's always useful!

@tlienart tlienart closed this as completed Jul 8, 2023
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

2 participants