Fork me on GitHub
#shadow-cljs
<
2018-03-05
>
cmal03:03:24

Hi, are there any examples to use shadow-cljs do server-side-rendering for NodeJS-Express.js apps?

denik17:03:20

@thheller 😏

shadow-cljs - server starting ...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................^C
upgraded shadow-cljs to 2.2.3 and server takes forever to start. Any idea what I might be doing wrong?

thheller17:03:32

hmm weird. anything in cat .shadow-cljs/*.log or try shadow-cljs server?

denik17:03:28

is this a problem: 12:12:10.950 [main] WARN shadow.cljs.devtools.server - TCP Port 9630 in use.

thheller17:03:44

no it should try the next automatically

denik17:03:16

okay, server errored because the port is in use.

denik17:03:37

12:16:49.736 [main] WARN shadow.cljs.devtools.server - TCP Port 9630 in use.
12:16:49.736 [main] DEBUG io.undertow - starting undertow server [email protected]
12:16:49.737 [XNIO-2 I/O-1] DEBUG org.xnio.nio - Started channel thread 'XNIO-2 I/O-1', selector [email protected]
12:16:49.737 [XNIO-2 I/O-2] DEBUG org.xnio.nio - Started channel thread 'XNIO-2 I/O-2', selector [email protected]
12:16:49.737 [XNIO-2 I/O-3] DEBUG org.xnio.nio - Started channel thread 'XNIO-2 I/O-3', selector [email protected]
12:16:49.737 [XNIO-2 I/O-4] DEBUG org.xnio.nio - Started channel thread 'XNIO-2 I/O-4', selector [email protected]
12:16:49.737 [main] DEBUG io.undertow - Configuring listener with protocol HTTP for interface 0.0.0.0 and port 9631
12:16:49.738 [XNIO-2 Accept] DEBUG org.xnio.nio - Started channel thread 'XNIO-2 Accept', selector [email protected]
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)
        clojure.tools.nrepl.server/start-server (server.clj:145)
        clojure.tools.nrepl.server/start-server (server.clj:121)
        shadow.cljs.devtools.server.nrepl/start (nrepl.clj:278)
        shadow.cljs.devtools.server.nrepl/start (nrepl.clj:266)

Error encountered performing task 'run' with profile(s): 'base,system,user,provided,dev'
Suppressed exit

thheller17:03:41

ah doh. I'm not looking at errors in start.

thheller17:03:00

thats the nrepl port

thheller17:03:14

that does not try other ports and fails

thheller17:03:25

ie. conflict with another nrepl port

denik17:03:55

hmm, could only be in use by a previous instance of shadow-cljs

thheller17:03:06

try shadow-cljs stop

denik17:03:12

already did

denik17:03:17

is that the kill-all cmd?

denik17:03:35

... version: 2.2.3
shadow-cljs - server not running

thheller17:03:02

hmm yeah you might have an orphan process hanging arround

thheller17:03:11

jps lists all java processes

thheller17:03:34

just kill it

denik17:03:54

have a few repls running, trying to narrow it down to the shadow-cljs ones

thheller17:03:57

there is something weird going on with java processes hanging around when the node process gets killed

thheller17:03:11

jvisualvm might help

thheller17:03:43

or connect to the actual nrepl port

thheller17:03:51

lein nrepl :connect the-port

thheller17:03:01

and then (System/exit 1)

thheller17:03:14

lein repl not nrepl

denik17:03:28

@thheller just killed all. Is there a way to link a process back to the execution command? As in all processes started by shadow-cljs *

thheller17:03:48

not with start as the node process exits

thheller17:03:34

besides that I guess jvisualvm is the best option

denik17:03:47

gave a brief look but it was a bit much to get into. killing all was the faster option

hlolli20:03:32

in the node repl I'm getting strange error, that was fixed seemingly while ago for

(defprotocol Fun-Time (drinky-drinky [_]))
i get
IllegalStateException: Can't change/establish root binding of: *unchecked-if* with set
reported here https://groups.google.com/forum/#!msg/clojurescript/__Qf6L40cwU/MP7pTpTFDAAJ I explicitly added the most recent clojurescript as dependency, but this may be clojurescript bug.