JuliaGizmos / Escher.jl

Composable Web UIs in Julia
https://juliagizmos.github.io/Escher.jl
Other
335 stars 63 forks source link

Pages from `escher --serve` appear blank #80

Closed dbeach24 closed 8 years ago

dbeach24 commented 8 years ago

I'm trying out Escher for the first time. I've just installed the latest julia 0.4 nightly and have updated all my packages (as of 6 Sept 2015). When I try to serve up any of the examples, I just get a blank page in the browser (tested using Chrome and Safari). Selecting "View Source" from the browser clearly shows some HTML with a lot of Javascript code, but I never see a webpage.

$ escher --serve layout.jl 

lots of deprecation warnings....

Listening on 0.0.0.0:5555...

What am I doing wrong?

rohitvarkey commented 8 years ago

Can you try Pkg.checkout("Mux") and Pkg.checkout("HttpServer") and see if it makes a difference?

dbeach24 commented 8 years ago

OK, I did this, but both packages were already at the latest version. Same result when I tried again.

When I navigate to localhost:5555, the HttpServer is clearly serving up content, but for whatever reason, it just doesn't cause anything to appear in the browser window.

shashi commented 8 years ago

@dbeach24 you don't need to run escher --serve layout.jl, just escher --serve should work

@rohitvarkey could this be related to https://github.com/one-more-minute/Mux.jl/pull/12 ?

rohitvarkey commented 8 years ago

Oh yes! I forgot that wasn't merged yet.

@dbeach24 Can you open your browser console and see if there is a 500 error being shown? Ctrl+Shift+J or Ctrl+Alt+J (for OSX) on Chrome will open it up.

NOTtheMessiah commented 8 years ago

reproduced on the latest julia-git v0.4, but the only errors in the Chrome console are:

GET http://localhost:5555/assets/bower_components/paper-shadow/paper-shadow.html 404 (Not Found)

which is not relevant, and

WebSocket is already in CLOSING or CLOSED state.    escherd.html:60 

root node on the DOM inspector is empty though.

shashi commented 8 years ago

Hmm, are you using the latest WebSockets.jl? The most recent release has a bugfix.

dbeach24 commented 8 years ago

Okay. Yes, I see these two errors in the Javascript console when I load the page in Chrome:

(index):2140 GET http://localhost:5555/assets/bower_components/webcomponentsjs/webcomponents.min.js 
(index):2140 GET http://localhost:5555/assets/basics.html 500 (Internal Server Error)
dbeach24 commented 8 years ago

Okay, I just updated packages:

julia> Pkg.update()
INFO: Updating METADATA...
INFO: Updating HttpServer...
INFO: Updating Mux...
INFO: Computing changes...
INFO: No packages to install, update or remove

The webpage now shows the following message:

/Users/dbeach/.julia/v0.4/Escher/examples/index.jl could not be found.

And I get the following messages in the Javascript console:

escherd.html:44 WebSocket connection to 'ws://localhost:5555/socket/index.jl?w=1023&h=579' failed: Close received after close
escherd.html:57 Error in web socket connection Event {}bubbles: falsecancelBubble: falsecancelable: falsecurrentTarget: WebSocketdefaultPrevented: falseeventPhase: 0path: Array[0]returnValue: truesrcElement: WebSockettarget: WebSockettimeStamp: 1441668001306type: "error"__proto__: Event
rohitvarkey commented 8 years ago

@dbeach24 http://localhost:5555/layout.jl maybe?

dbeach24 commented 8 years ago

@rohitvarkey Just tried that. That gives me a webpage with the following Julia traceback:

LoadError: TypeError: Tuple: in parameter, expected Type{T}, got Tuple{DataType,DataType}
while loading /Users/dbeach/.julia/v0.4/Escher/examples/layout.jl, in expression starting on line 10
 in loadfile at /Users/dbeach/.julia/v0.4/Escher/src/cli/serve.jl:24
 in anonymous at /Users/dbeach/.julia/v0.4/Escher/src/cli/serve.jl:165
 in anonymous at /Users/dbeach/.julia/v0.4/Mux/src/Mux.jl:15
 in anonymous at /Users/dbeach/.julia/v0.4/Mux/src/Mux.jl:8
 in splitquery at /Users/dbeach/.julia/v0.4/Mux/src/basics.jl:28
 in anonymous at /Users/dbeach/.julia/v0.4/Mux/src/Mux.jl:8
 in wcatch at /Users/dbeach/.julia/v0.4/Mux/src/websockets_integration.jl:12
 in anonymous at /Users/dbeach/.julia/v0.4/Mux/src/Mux.jl:8
 in todict at /Users/dbeach/.julia/v0.4/Mux/src/basics.jl:21
 in anonymous at /Users/dbeach/.julia/v0.4/Mux/src/Mux.jl:12 (repeats 2 times)
 in anonymous at /Users/dbeach/.julia/v0.4/Mux/src/Mux.jl:8
 in anonymous at /Users/dbeach/.julia/v0.4/Mux/src/server.jl:38
 in handle at /Users/dbeach/.julia/v0.4/WebSockets/src/WebSockets.jl:354
 in on_message_complete at /Users/dbeach/.julia/v0.4/HttpServer/src/HttpServer.jl:363
 in on_message_complete at /Users/dbeach/.julia/v0.4/HttpServer/src/RequestParser.jl:103
 in http_parser_execute at /Users/dbeach/.julia/v0.4/HttpParser/src/HttpParser.jl:92
 in process_client at /Users/dbeach/.julia/v0.4/HttpServer/src/HttpServer.jl:335
 in anonymous at task.jl:448
rohitvarkey commented 8 years ago

@dbeach24 Oh. Sorry. The examples are broken on v0.3. Pkg.checkout("Escher") should solve this.

dbeach24 commented 8 years ago

@rohitvarkey That seems to have fixed it. (I was never using v0.3, so I don't quite understand the comment there.) Anyhow, thanks!

rohitvarkey commented 8 years ago

@dbeach24 Sorry for all the trouble! We plan to release a new version of Escher soon and Mux will also get a new release, so things should just work out of the box from then on. :smile: