Hello !

I strictly followed the tutorial here : 
https://clojurescript.org/guides/quick-start

Clojurescript is perfectly compiling the hello-world.core namespace. 
Browser shows up, on terminal I can read "Hello World". 

> clj --main cljs.main --verbose --compile hello-world.core --repl

Options passed to ClojureScript compiler: {:output-dir "out", 
:closure-warnings {:check-types :off, :check-variables :off}, 
:closure-defines {}, :ups-libs nil, :cache-analysis true, 
:closure-module-roots [], :optimizations :none, :ups-foreign-libs [], 
:verbose true, :aot-cache true, :preloads [process.env 
clojure.browser.repl.preload], :ignore-js-module-exts [".css"], :output-to 
"out/main.js", :preamble ["cljs/imul.js"], :browser-repl true, :ups-externs 
nil, :opts-cache "cljsc_opts.edn", :source-map true, :cache-analysis-format 
:transit, :main hello-world.core, :emit-constants nil, :npm-deps false}
REPL env options: {:output-dir "out"}
Reading analysis cache for 
jar:file:/home/stup3fait/.m2/repository/org/clojure/clojurescript/1.10.439/clojurescript-1.10.439.jar!/cljs/core.cljs
Hello world

*But I never get the repl prompt. *

No errors in chrome dev console, nor in terminal. Something seems to 
"block".

I tried several version of clojurescript, same problem.

>From the browser perspective, when I hit F5, there are 4 XHR requests sent 
to localhost:9000 :

Request 1 : response = 
{"repl":"Thread-263","form":"cljs.core._STAR_print_fn_STAR_ = 
clojure.browser.repl.repl_print;\ncljs.core._STAR_print_err_fn_STAR_ = 
clojure.browser.repl.repl_print;\ncljs.core._STAR_print_newline_STAR_ = 
true;\nif((cljs.core.count.call(null,clojure.browser.repl.print_queue) > 
(0))){\nclojure.browser.repl.flush_print_queue_BANG_(cljs.core.deref.call(null,clojure.browser.repl.xpc_connection));\n}
 
else {\n}\n"}
Request 2 : response =  ignore__
Request 3 : response = ignore__
Request 4 : interstingly, this request do not responds. It's in PENDING 
state.

Those 4 requests are about robots.txt (!?), like : 
http://localhost:9000/repl?xpc=%7B%22cn%22%3A%22mpJZAw6akG%22%2C%22tp%22%3Anull%2C%22osh%22%3Anull%2C%22ppu%22%3A%22http%3A%2F%2Flocalhost%3A9000%2Frobots.txt%22%2C%22lpu%22%3A%22http%3A%2F%2Flocalhost%3A9000%2Frobots.txt%22%7D

I tried both firefox and chrome with same behaviour.

This hanging request may not be the reason why my repl never shows up. I 
don't really understand how the repl and the browser are wired together.
I was expecting some kind of websocket connection for communication between 
browser and repl but none is opened.

If I launch a node repl (--repl-env node), I got a repl prompt and can play 
with my app.

When I quit the browser, I have a "Broken pipe" java exception in terminal, 
so terminal is somehow connected with browser.

Did you solve this problem in the past ?

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.

Reply via email to