rdeits / MeshCat.jl

WebGL-based 3D visualizer in Julia
MIT License
233 stars 42 forks source link

Cannot establish a connection to the visualizer in Julia v1.8 #234

Closed samufi closed 1 year ago

samufi commented 1 year ago

The following simple code runs on Julia v1.6 but not on v1.8.

using MeshCat

visualizer = Visualizer()
open(visualizer)
setvisible!(visualizer, true)
wait(visualizer)

With Julia 1.8, I get the following error message:

┌ Info: MeshCat server started. You can open the visualizer by visiting the following URL in your browser:
└ http://127.0.0.1:8700
ERROR: LoadError: Could not establish a connection to the visualizer.
Stacktrace:   
 [1] error(s::String)
   @ Base .\error.jl:35
 [2] wait_for_server(core::MeshCat.CoreVisualizer, timeout::Int64)
   @ MeshCat C:\Users\user\.julia\packages\MeshCat\QqqKF\src\servers.jl:24  
 [3] wait_for_server
   @ C:\Users\user\.julia\packages\MeshCat\QqqKF\src\servers.jl:10 [inlined]
 [4] #open#91
   @ C:\Users\user\.julia\packages\MeshCat\QqqKF\src\servers.jl:31 [inlined]
 [5] open
   @ C:\Users\user\.julia\packages\MeshCat\QqqKF\src\servers.jl:30 [inlined]
 [6] #open#90
   @ C:\Users\user\.julia\packages\MeshCat\QqqKF\src\servers.jl:7 [inlined]
 [7] open(::Visualizer)
   @ MeshCat C:\Users\user\.julia\packages\MeshCat\QqqKF\src\servers.jl:7
 [8] top-level scope
   @ C:\Users\user\Project\src\visualize.jl:5
in expression starting at C:\Users\user\Project\src\visualize.jl:5

I am using a fresh Julia environment on Windows 10.

janbruedigam commented 1 year ago

I think that's a similar issues as #233

ferrolho commented 1 year ago

On macOS, I can kinda reproduce this issue. The Julia REPL, seems to halt when doing open(visualizer). ~Interestingly, from a Jupyter notebook (on Jupyter lab) this is not an issue.~

Edit: I've found that the issue is not that we can't establish a connection with the server; instead, the server is not even starting. This seems to have started from WebSockets version 1.6.

ferrolho commented 1 year ago

This should be solved in MeshCat.jl v0.15.1. Please check it out and re-open this issue if that is not the case. Thanks!