When I precompile my Dash application in the Julia REPL, it fails as address is already in use. I have to exit the REPL and kill the server manually. I have already tried a try catch block but it doesn't work.
# Code
using Dash
app = dash(suppress_callback_exceptions=true)
run_server(app, "127.0.0.1", dev_tools_hot_reload=true, debug=true)
This is the error I get:
# Error
ERROR: LoadError: IOError: listen: address already in use (EADDRINUSE)
Stacktrace:
[1] uv_error
@ .\libuv.jl:97 [inlined]
[2] #listen#13
@ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Sockets\src\Sockets.jl:632 [inlined]
[3] #listen#10
@ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Sockets\src\Sockets.jl:625 [inlined]
[4] listen
@ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Sockets\src\Sockets.jl:623 [inlined]
[5] #72
@ C:\Users\jorda\.julia\packages\Dash\soFjZ\src\server.jl:54 [inlined]
[6] run_server(app::Dash.DashApp, host::String, port::Int64; debug::Bool, dev_tools_ui::Nothing, dev_tools_props_check::Nothing, dev_tools_serve_dev_bundles::Nothing, dev_tools_hot_reload::Bool, dev_tools_hot_reload_interval::Nothing, dev_tools_hot_reload_watch_interval::Nothing, dev_tools_hot_reload_max_retry::Nothing, dev_tools_silence_routes_logging::Nothing, dev_tools_prune_errors::Nothing)
@ Dash C:\Users\jorda\.julia\packages\Dash\soFjZ\src\server.jl:66
[7] top-level scope
@ C:\Users\jorda\Documents\GitHub\FYP-Geographical-Data-Visualiser\Geovisualisation\src\Geovisualisation.jl:402
[8] include
@ .\Base.jl:386 [inlined]
[9] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
@ Base .\loading.jl:1235
[10] top-level scope
@ none:1
[11] eval
@ .\boot.jl:360 [inlined]
[12] eval(x::Expr)
@ Base.MainInclude .\client.jl:446
[13] top-level scope
@ none:1
I then have to manually kill the server on the port
# Kill server (Windows)
netstat -ano | findstr :8050
# Kill server (MacOS)
$ sudo lsof -t -i tcp:8050 | xargs kill -9
My Julia version is 1.6.2
julia> VERSION
v"1.6.2"
Is there a way to either skip that line of code or skip precompile?