adzerk-oss / boot-cljs-repl

Boot task providing a REPL for ClojureScript development.
Eclipse Public License 1.0
72 stars 28 forks source link

Starting REPL freezes #57

Closed DonyorM closed 6 years ago

DonyorM commented 7 years ago

So I'm trying to run a boot cljs repl in my browser, but I'm having issues.

I run the command: boot dev watch reload cljs-repl cljs start-server wait in one terminal, then open another terminal and run: repl -c -H localhost -p <nrepl-port>. Inside the repl I call (start-repl), upon which I get the following output:

user=> (adzerk.boot-cljs-repl/start-repl)
<< started Weasel server on ws://127.0.0.1:46366 >>
<< waiting for client to connect ... Connection is ws://localhost:46366
Writing boot_cljs_repl.cljs...

Then the repl freezes indefinitely and will not connect to the cljs repl. What am I doing wrong in this scenario?

DonyorM commented 6 years ago

Any idea why this is happening?

winmillwill commented 6 years ago

I had this and found that the port in the browser console did not match the port in the boot output. After deleting all boot outputs and building from scratch, I still had the same problem. The port in the output kept changing but the port in the console error stayed the same. I took a look at the headers for the js asset and found that it was loaded from memory cache.

Incognito worked fine, and after doing "Empty cache and force reload" from the right click menu on the browser reload button, everything was fine.

DonyorM commented 6 years ago

That didn't help. How did you check the port of the browser console?

DonyorM commented 6 years ago

Any idea on how to fix this?

lindboe commented 6 years ago

I also got a freeze from running boot watch cljs-repl repl -c. I'm new to boot, and still working on trying to understand it, so I might be doing something wrong. Mine also stopped at the same point (Writing boot_cljs_repl.cljs...) I've also tried running boot repl -c separately, getting the same error, so I tried passing the host and port with arguments, but I get connection refused (it seems there are multiple servers in play here, but I don't know how they fit together yet). Still trying to dig into this myself.

If it helps, I was trying to add this to a play-cljs project.

DonyorM commented 6 years ago

Still experiencing this error. With the exact sytmpos of @lindboe. @Deraen or someone else involved with the project, any thoughts on this?

As far as I can tell, Saapas experiences this issue. To reproduce, clone that repo and try to run the cljs repl.

DonyorM commented 6 years ago

So yeah, all you need to do to fix this is to reload the page on your web server after you call (start-repl) in the connected repl.