Fork me on GitHub
#shadow-cljs
<
2021-04-02
>
Vincent Cantin13:04:53

Hi, during the compilation on our project, the compiler hangs, seemingly on a deadlock situation. We suspect that it may be related to a namespace dependency cycle. Is it plausible or not?

thheller14:04:57

unlikely. dependency cycles are detected in the resolve stage before it gets to compilation

thheller14:04:43

most common problem is a macro expanding endlessly

thheller14:04:53

the compiler should self-terminate if it makes no progress for 60seconds

Vincent Cantin14:04:32

That's what happen, it terminates after some time and namespaces say which other ones they were waiting for.

thheller14:04:33

the check what that namespace does

👍 3
Vincent Cantin21:04:12

@U05224H0W I found the problem which caused Shadow-CLJS to hang, and that might interest you:

(ns foo.core
  (:require [bar_baz :as baz])) ;; typo, "_" instead of "-"

Vincent Cantin21:04:33

Maybe a "_" in a namespace should trigger a warning.

thheller08:04:19

ah. please open an issue about that so I don't forget.

3
lispers-anonymous14:04:10

I keep getting these messages printed into my repl, and can't find much about it searching online

10:47:01.189 [XNIO-1 I/O-1] DEBUG io.undertow.websockets.core.request - UT025003: Decoding WebSocket Frame with opCode 1
The are printed every couple of seconds. Seemingly when ping/pong messages are exchanged over the websocket between shadow and my site in a browser session. Is there any way to hide these? They started showing up recently and I'm unsure what I did to trigger these to appear.

thheller14:04:43

looks like you are running shadow-cljs in embedded mode? ie. embedded in your CLJ process started from the REPL or so?

lispers-anonymous14:04:10

Maybe so? I started my repl with cider-jack-in-cljs. Maybe I will have different results if I start shadow in a terminal and connect to that through cider

thheller14:04:23

if you start it in embedded mode shadow-cljs inherits your jvm logging setup. so you'd configure that logging via your log4j.properties logback.xml or whatever logging you are using

thheller14:04:55

if you start it separately those logs should not appear

lispers-anonymous14:04:48

I started my repl with shadow-cljs watch app and connected manually with cider. I still see the messages, both in my terminal and my connected cider repl. We do have a logback.xml in this project. I will try to exclude these logs somehow. Do you happen to know what the logger name would be for these messages?

lispers-anonymous14:04:38

Trying this <logger name="io.undertow.websockets.core.request" level="WARN" /> first

thheller15:04:31

I can never remember how to configure this stuff either but logback.xml is the place to do it 🙂

thheller15:04:37

you can use name="io.undertow" since you likely don't care about any of the messages it outputs. not just that ns.

lispers-anonymous15:04:15

I will play around with it. I am not the logback guy at my work. Someone will know how to do it though.

lispers-anonymous15:04:32

Thank you for your help. I really appreciate how responsive you are in this channel.

thheller15:04:39

happy to help

🙏 3
lispers-anonymous15:04:27

I have figured it out. My logback.xml lives in config/logback.xml . I believe one of my dependencies also had some logback stuff defined in it, and that is what my repl was picking up. I added "config" to my :source-paths in shadow-cljs.edn and added this line to my logback.xml file

<logger name="io.undertow" level="OFF" />
Without modifying my source paths my logback wasn't picked up. Now that it is, my repl is cleared up.

👍 3
lispers-anonymous15:04:27

I have figured it out. My logback.xml lives in config/logback.xml . I believe one of my dependencies also had some logback stuff defined in it, and that is what my repl was picking up. I added "config" to my :source-paths in shadow-cljs.edn and added this line to my logback.xml file

<logger name="io.undertow" level="OFF" />
Without modifying my source paths my logback wasn't picked up. Now that it is, my repl is cleared up.

👍 3