Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect to shadowcljs repl #240

Open
introom opened this issue Jul 17, 2019 · 3 comments
Open

Cannot connect to shadowcljs repl #240

introom opened this issue Jul 17, 2019 · 3 comments

Comments

@introom
Copy link

introom commented Jul 17, 2019

Steps to reproduce:

  1. lein new luminus luminus-app +re-frame +shadow-cljs +aleph
  2. lein shadow watch app
  3. shadow-cljs cljs-repl app

In step 3, we get the error:
2019-07-17 13:53:11,006 [main] INFO org.xnio - XNIO version 3.7.0.Final
2019-07-17 13:53:11,103 [main] INFO org.jboss.threads - JBoss Threads version 2.3.2.Final
2019-07-17 13:53:11,122 [main] DEBUG io.undertow - Configuring listener with protocol HTTP for interface 0.0.0.0 and port 9630
[2019-07-17 13:53:11.170 - WARNING] TCP Port 9630 in use.
2019-07-17 13:53:11,178 [main] DEBUG io.undertow - starting undertow server io.undertow.Undertow@f1b70d5
2019-07-17 13:53:11,198 [main] DEBUG io.undertow - Configuring listener with protocol HTTP for interface 0.0.0.0 and port 9631
[2019-07-17 13:53:11.722 - WARNING] :shadow.cljs.devtools.server/nrepl-ex
BindException Address already in use (Bind failed)
java.net.PlainSocketImpl.socketBind (PlainSocketImpl.java:-2)
java.net.AbstractPlainSocketImpl.bind (AbstractPlainSocketImpl.java:387)
java.net.ServerSocket.bind (ServerSocket.java:375)
java.net.ServerSocket.bind (ServerSocket.java:329)
nrepl.server/start-server (server.clj:128)
nrepl.server/start-server (server.clj:96)
shadow.cljs.devtools.server.nrepl04/start (nrepl04.clj:376)
shadow.cljs.devtools.server.nrepl04/start (nrepl04.clj:359)
clojure.lang.Var.invoke (Var.java:384)
shadow.cljs.devtools.server/start-system/fn--31019 (server.clj:331)
shadow.cljs.devtools.server/start-system (server.clj:301)
shadow.cljs.devtools.server/start-system (server.clj:242)
shadow-cljs - server version: 2.8.39 running at http://localhost:9631

@nikolap
Copy link
Member

nikolap commented Jul 17, 2019

If you're trying to access the cljs nrepl with shadow you should do:

lein repl :connect 7002

Or, if using an IDE that lets you connect to an nREPL, you just need to set port to 7002 and host to localhost.

Once in the REPL,

(shadow/repl :app)

Let me know if that works, or if you're trying to do something else and I misunderstood the issue.

Source: http://www.luminusweb.net/docs/clojurescript.html#developing_with_shadow-cljs

@introom
Copy link
Author

introom commented Jul 17, 2019

@nikolap this works.

could i directly connect to repl? that is, combining the :connect 7002 and the (shadow/repl :app) step?

also, i was following here: https://shadow-cljs.github.io/docs/UsersGuide.html#cljs-repl

$ shadow-cljs watch build-id
...

# different terminal
$ shadow-cljs cljs-repl build-id
shadow-cljs - connected to server
[3:1]~cljs.user=>

where it first uses watch, then uses cljs-repl buid-id.

@nikolap
Copy link
Member

nikolap commented Jul 19, 2019

I don't think you can connect directly, I forgot all the steps before, but there was always that need to switch to the cljs repl since the nrepl starts in a clojure environment...

And yeah, hm see what you mean from the shadow-cljs docs. I'll poke around later to see what prevents you from being able to do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants