Fork me on GitHub

Are you still optimistic about the worker stuff?


hello, I've a project that I'm getting a lot of debug logs like

19:40:50.929 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider
19:40:51.646 [main] INFO  io.undertow - starting server: Undertow - 2.0.30.Final
19:40:51.655 [main] INFO  org.xnio - XNIO version 3.8.0.Final
19:40:51.664 [main] INFO  org.xnio.nio - XNIO NIO Implementation Version 3.8.0.Final
19:40:51.728 [main] INFO  org.jboss.threads - JBoss Threads version 3.1.0.Final
19:40:51.737 [XNIO-1 I/O-2] DEBUG org.xnio.nio - Started channel thread 'XNIO-1 I/O-2', selector .KQueueSelectorImpl@5629534f
19:40:51.737 [XNIO-1 I/O-3] DEBUG org.xnio.nio - Started channel thread 'XNIO-1 I/O-3', selector .KQueueSelectorImpl@16c6fc08
19:40:51.737 [XNIO-1 I/O-4] DEBUG org.xnio.nio - Started channel thread 'XNIO-1 I/O-4', selector .KQueueSelectorImpl@36eb2669
19:40:51.737 [XNIO-1 I/O-6] DEBUG org.xnio.nio - Started channel thread 'XNIO-1 I/O-6', selector .KQueueSelectorImpl@e6ef0ab
19:40:51.737 [XNIO-1 I/O-1] DEBUG org.xnio.nio - Started channel thread 'XNIO-1 I/O-1', selector .KQueueSelectorImpl@7624cb9a
19:40:51.737 [XNIO-1 I/O-7] DEBUG org.xnio.nio - Started channel thread 'XNIO-1 I/O-7', selector .KQueueSelectorImpl@3ccd03ca
19:40:51.737 [XNIO-1 I/O-5] DEBUG org.xnio.nio - Started channel thread 'XNIO-1 I/O-5', selector .KQueueSelectorImpl@d9f96cd
19:40:51.738 [XNIO-1 I/O-8] DEBUG org.xnio.nio - Started channel thread 'XNIO-1 I/O-8', selector .KQueueSelectorImpl@5b9f145d


is there a way for me to debug why I'm getting the verbose, and how to tune it down?


Q: I like the “hacking libraries” capability. Should this also work for hacking npm dep sources?


@wilkerlucio if you are running the embedded version logging is subject to your logging config. so you configure it and can just disable it if you want.


Good to know. Thanks. I can still do the local clone/patch with my npm deps. that’s working well.


@thheller do you have an example of that config?


I don't. You do.


What do you use for logging in your app?


logback.xml,, etc?


nothing, I'm guessing some dependency is doing it


check via shadow-cljs clj-repl ( "logback.xml") or so


something must be configuring the logging somewhere


I'm a bit rusty when it comes to jvm logging setups


it seems to happen on my deps projects, on lein ones it seems normal


not just on shadow really, I see the same issue in other projects with just deeps


gonna dig down


check your dependencies for a logging lib


log4j, logback etc


some libs have direct deps on them when they shouldn't


need to find which lib is doing the actual logging to disable it 😛


@wilkerlucio in one classpath root with

log4j.rootLogger=INFO, console
log4j.appender.console.layout.ConversionPattern=[%d{HH:mm:ss,SSS}] %m%n


should make it shutup .. but only if your logger is log4j


I don't have a config for logback

Andrea Russo08:04:34

I have an hybrid project, where I use some JSX files. I’m able to convert them with babel in standard JS and consume them from ClojureScript in a re-frame app.

Andrea Russo08:04:01

my problem arises when I try to import a local Js file in another JS file

Andrea Russo08:04:56

import { ProTip } from ‘./ProTip’;

Andrea Russo08:04:27

the closure compiler says that it can’t understand import from directories


please post actual code with actual messages. makes it much harder to follow if you shorten things.

Andrea Russo08:04:42

yes sorry I’m trying to replicate the problem, now I have other errors that happens before the one I described


I don't really recommend including too many .js files. the system isn't really tuned for that and has a lot of issues I haven't had time to work on.

Mark Bailey08:04:52

Hey everyone! Setting up a new template for projects and shadow keeps alerting me "Stale Client". Not sure why it keeps doing so, even on a page refresh


means you are loading outdated .js code


common cause is changing the output directory or names but not adjusting your html accordingly

Mark Bailey08:04:52

checking over my html, everything seems to be in place

Mark Bailey08:04:11

output dir is set correctly as well it seems


if you are using a different http server it might be caching related


could also be that you have 2 separate shadow-cljs instances running competing with each other

Mark Bailey09:04:00

what if they are running on different ports?

Mark Bailey09:04:22

i have two dev instances running on different tmux boxes but on separate ports


I mean in the same project


you can have as many different projects as you like


just don't run shadow-cljs twice in the same project

Mark Bailey09:04:20

okay, that makes sense but that doesn't seem to be whats going on. mind if i throw you a github link?

Mark Bailey09:04:14

committing now, one sec. sorry for the delay

Mark Bailey09:04:29

in the meantime, @thheller you did an absolutely stellar job with shadow, my guy. CLJS has been an incredible journey and shadow has drastically improved my ux!


looks fine. a bit dated maybe but fine.

Mark Bailey09:04:19

did a clean and im running npm install again. i'll go through the whole set up and if it works


{init-fn app.core/init} is incorrect though

Mark Bailey09:04:04

okay! that was my initial guess as to why it wasn't giving me a non-stale build


{:source-paths ["src"]

 :dependencies [[nrepl "0.7.0"]
                [cider/cider-nrepl "0.25.0-alpha1"]
                [proto-repl "0.3.1"]
                [binaryage/devtools "1.0.0"]
                [reagent "0.10.0"]
                [re-frame "0.12.0"]
                [ "0.6.2"]
                [bidi "2.1.6"]
                [kibu/pushy "0.3.8"]]
 :nrepl {:port 3334}

 :dev-http {8080 "public"}

  {:target :browser
   :output-dir "public/js"
   :asset-path "/js"

    {:init-fn app.core/init
     :preloads []}}

    {:closure-defines {re-frame.trace/trace-enabled? true


shadow-cljs watch app should complain about the bad {init-fn ...}?


so yeah it would be stale after that since it never finishes the compile

Mark Bailey09:04:31

no complaint, and says build completed


fixed in master 😉

Mark Bailey09:04:27

i'm sorry i don't understand, i've never had someone else edit my code with git


no I mean I fixed it in shadow-cljs. with the next release {init-fn ...} will fail properly and show an error

Mark Bailey09:04:33

wow. my level of tiredness is showing

Mark Bailey10:04:09

@thheller I've gone through every setting I can think of to no avail. It's still giving me a stale client warning

Mark Bailey10:04:03

I am going through Jacek Schae's tutorial on re-frame, this is basically his template, just with updated deps. everything is fine running his template, but as soon as i update deps, things get wonky with the stale client warning


@mbbailey96 verify that you are actually loading what you are think you are loading


you get a stale client warning when the .js you are loading was not produced by the running watch


there aren't that many places that can cause this

Mark Bailey11:04:15

main.js is supplied by watch afaik, which is being compiled. it is stored in my js/ folder, which is definitely linked in my index.html.

Mark Bailey11:04:05

I haven't been getting any build errors, main is compiled and in the right directory, i just don't know what I am missing

Mark Bailey11:04:23

when I try to run (js/alert) it's giving me an error "No such namespace: js". Can't interact with the site at all through repl. Might this be a cause or a help determining what is going wrong?


that means you are in a CLJ REPL not a CLJS REPL


but not that doesn't mean anything


lets go step by step


shut down shadow-cljs


open the webpage? do you get something? if yes something else is running somewhere


delete public/js


open the webpage? does it 404 properly?


you are looking all over the place if all you need to check if file you think you are loading are the actual files you are looking at

Mark Bailey11:04:25

@thheller i was still getting connection from elsewhere.

Mark Bailey11:04:33

thank you for all the help!!

Andrea Russo13:04:16

I can’t believe that yesterday this import (and others) worked:

Andrea Russo13:04:31

(ns dias-web.common-ui (:require [re-frame.core :as re-frame] [dias-web.subs :as subs] [“@material-ui/core/styles/MuiThemeProvider” :default ThemeProvider] [“@material-ui/core/styles” :refer [createMuiTheme withStyles]] [“@material-ui/core/colors” :as mui-colors] [“@material-ui/core/CssBaseline” :default CssBaseline] [“@material-ui/core/Typography” :default Typography] ; [“@material-ui/core/Avatar” :default mui-avatar] ; [“@material-ui/icons/Android” :default AndroidIcon] [“@material-ui/core/AppBar” :default AppBar] [“@material-ui/core/Toolbar” :default ToolBar] [“@material-ui/core/IconButton” :default IconButton] [“@material-ui/icons/Menu” :default MenuIcon] [“@material-ui/core/Button” :default Button]))

Andrea Russo13:04:46

and today everything compiles but at runtime it says:

Andrea Russo13:04:55

Failed to load dias_web/common_ui.cljs Module not provided: module$node_modules$$material_ui$core$styles$index

Andrea Russo13:04:16

It’s very strange, everything the same as yesterday


I would like to ask for some orientation (I am already reading the docs but I have some questions that are more basic than what the docs assumes). Basically, I am not even sure if it's possible, or rather I assume it's possible but I am not sure if I should do what I want to do : ) I would like to have specs added next to my devcards build that would complain during development if I mess up some argument to functions (or let bindings in components) or the output of some functions. Is there some guide regarding this that I could read to get up to speed?


@andrea.russo looks fine as far as I can tell. "Failed to load" sort of creates a chain reaction. One thing fails to load and then a whole bunch of others that depend on that also fail so you gotta fine the actual failing thing


@ashnur clarify "specs added"? shadow-cljs only compiles stuff for you. you are responsible for adding stuff to the build and requiring it. I typically recommend adding specs to extra namespaces. so for (ns you also have (ns and then load that ns via :preloads or some other means


adding the files and writing in the namespace and the tests is what is the most clear thing in this process


the preloads stuff, I have no idea why it is preload, compared to what, I am guessing there is a lot of history here where these names and approaches are coming from. I only know javascript, if I want something like this, I have to bundle in with the rest of the app


:preloads is badly named yes but it is what it is. It is for namespaces that should only be added to the build in development.


sorry, I didn't mean to criticize, I just don't understand 😐


they are added "before" the other code so they are sometimes loaded before the other code


but they can depend on other code in which they that code will be loaded before them


ok, so it is similar as the namespace that I write in my file?


it IS just a regular namespace yes


you just don't require them from any other namespaces


I hate when I am stupid, I added the file, wrote in the namespaces, specified the file/namespace in the vector of preloads for the build that I am running, if I change the file I can see shadowcljs picking the change up and rebuilding, but a simple (prn 'foo) has no output


the relationship between namespaces/filenames is as obscure as ever for me


so I use the same for both, hopefully that should work


@ashnur you are not stupid. you are learning, it is ok to make mistakes. it is ok to ask questions ... that is how we learn.

👏 16

namespace and filename are really the same thing. there are just a few basic rules for namespaces and which filename they should have


(ns should be foo/bar.cljs


(ns foo.with-a-dash) should be foo/with_a_dash.cljs


the names go onto the classpath, meaning you pick one of your source-paths and put them there


thats it really


and yes the name of the namespace MUST match the filename


otherwise it won't be found


prn not showing up I don't know. if you do everything correctly it should.


it works, for some reason I forgot to put the :preloads under :devtools facepalm


hey thheller, I am getting a bunch of $jscomp errors when using dependencies that ship es6+ code, unless I bump :output-feature-set to match the level required not to compile them


a not-completely-minimal-example is this project: when i boot this up, I see a couple errors about $jscomp.makeIterator changing the :output-feature-set to :es6 makes these go away. then I try and type something in a field, which throws an error about $jscomp with the stacktrace pointing at an async function. bumping the :output-feature-set to :es8 makes this go away.

Andrea Russo16:04:26

@thheller I’ve found that if I delete the .shadow-cljs/ and rebuild everything works. As soon as I stop the build and the start another without deleting the .shadow-cljs directory, I have the module loading problem


i'll open a github issue

Andrea Russo16:04:51

I can share with you the repo I’m working on, if you are interested seeing this behaviour

Andrea Russo16:04:28

by deleting everytime the .shadow-cljs I’m able to work, which means I’m stuck again with another problem, maybe this one is something related to the closure compiler, which does not accept directory paths in javascript files when importing other files:

Andrea Russo16:04:34

losure compilation failed with 1 errors
--- App.js:6
Cannot import Closure files by path. Use either import goog:namespace or goog.require(namespace)

Andrea Russo16:04:05

These are imports from the App.js file:

Andrea Russo16:04:12

import * as React from ‘react’; import Container from ‘@material-ui/core/Container’; import Typography from ‘@material-ui/core/Typography’; import Box from ‘@material-ui/core/Box’; import Link from ‘@material-ui/core/Link’; import * as ProTip from ‘./ProTip’;

Andrea Russo16:04:31

and the problem is importing a local file called ProTip.js

Andrea Russo16:04:52

which is in the same directory of App.js

Andrea Russo16:04:40

oh sorry, and this is my shadow-cljs.edn

Andrea Russo16:04:40

{:lein true :nrepl {:port 8777} :builds {:app {:target :browser :output-dir “resources/public/js/compiled” :asset-path “/js/compiled” :modules {:app {:init-fn dias-web.core/init :preloads [devtools.preload]}} :dev {:compiler-options {:closure-defines {re-frame.trace.trace-enabled? true true}}} :devtools {:http-root “resources/public” :http-port 8280 }}}}

Andrea Russo16:04:31

oh now I read that you are discouraging having more than a bunch of js files in a shadow-cljs project

Andrea Russo16:04:15

any suggestion on how to coordinate me, using cljs, and my other cooworkers, using js? Maybe a magic live changing local node module in node_modules?

Ivan Fedorov18:04:20

Seeing those sometimes now after a version upgrade I think.

[:dev] Build failure:
------ ERROR -------------------------------------------------------------------
 File: /Users/spacegangster/clj/lightpad/client/src/flow/views/tasks/microtasks.cljs:6:1
   3 |             [ :as sc]
   4 |             [ :as sc]))
   5 |
   6 | (def ^:const dim-item-side-px (sc/px sc/dim-step))
Error in phase :compilation
Can't redefine a constant at line 6 flow/views/tasks/microtasks.cljs
   7 | (def ^:const dim-fs ".9rem")
   8 |
   9 | (def rules1
  10 |   [:.microtasks
Version output
=== Version                                                                        
jar:            2.8.97            
cli:            2.8.97               
deps:           1.3.2                   
config-version: 2.8.97  
Previously was on: ^2.8.91

Ivan Fedorov18:04:54

Will add an issue on demand


@ognivo just don't use ^:const. it doesn't do what you think it does. do not use it. there is no point. also why is [ :as sc] imported twice? line 3/4?

👍 4
Ivan Fedorov19:04:06

ok, thanks! I think I saw it somewhere in Mike Fikes twits


@andrea.russo I can't help much with this. I need something reproducible to figure out what is happening. deleting the cache shouldn't be necessary so that sounds like a bug.


I always thought bash was bad but the syntax of powershell is ridiculous .. who comes up with this shit ...

🙂 4

yea they messed up pretty bad

Andrea Russo22:04:38

@thheller I can give you access to the repo if you want to reproduce the behaviour. I’m really sorry, I’m in a hurry with a project at work and I don’t have time to contribute with a minimal project that exposes this behaviour.


i thought powershell syntax was intuitive 😄