Fork me on GitHub

I somehow got shadow-cljs into a state where running shadow-cljs release raises a NPE. My CIDER repl hot reloading is also broken. known bug?


I don't think I have anything fancy going on. I think CIDER just runs the default command, shadow-cljs server. I think this may have been a race condition from hot reload + release at the same time, but anyway it went away after a restart


Q: I’ve reached the stage where using tap> and the inspector would be really helpful. I’m using 2.8.94. Should it be working in the browser app? I can’t see any runtimes even though I have a nodejs server running. and when I (tap> []) from the cljs repl, nothing happens


I seem to remember it’s been disabled but I just want to ask


@steveb8n that version is too old for inspect. it is enabled by default in newer versions.


ok great. I can update and try it. Thanks. looking forward to using it


btw: I agree with @mail985 shadow rocks!


inspect working now. thx!

Jack Arrington11:08:15

Following examples to make a testing namespace and shadow is telling me node-test is an invalid target:

Target "node-test" for build :test was not found. The built-in targets are:
  - :browser
  - :browser-test
  - :node-script
  - :node-library
  - :npm-module
  - :karma
  - :bootstrap
Should I just be using node-script?


:target :node-test? should exist unless you are on an ancient version

Jack Arrington12:08:46

I just installed a few minutes ago

Jack Arrington12:08:32

Looking like I am running v 2.10.21

Jack Arrington12:08:47

I think it's a problem with my namespace directories actually - error seems to be coming from Looks like it's just an outdated error message 🙂.


I'm trying to run shadow watch for :node-script on a different (docker) host, than node app.js. :devtools-url "" yields remote-error Error: Unexpected server response: 200. What's the best way to do this?


@mail985 looks like you might be using :target node-test. note that it must be a keyword, otherwise it'll look for (ns node-test) which indeed does not exist.


@bendlas assuming that calling actually results in the shadow-cljs UI that should be fine? did you verify that the http connect actually works?


@U05224H0W it turns out, it does that, when a stale app.js tries to connect during shadow's boot up (docker volume, for sharing build results). removing app.js (and waiting for it to be re-generated) before connecting node, fixed it. thanks!


Is it currently possible to add a dependency while shadow watch is running? If not, are there any barriers for that feature to be added? I can take a look at it 🙂


not possible currently and not trivial to add given that it must be supported via shadow-cljs.edn, project.clj and deps.edn. I may add a shadow-cljs.edn solution some day but it is low priority. restarting occasionally is not that bad.


Thanks for the quick response! Yeah, doing some research over the past week it doesn't look trivial 😞


yeah manipulating the classloader at runtime is full of footguns. its easy for just .cljs files but macros and other resources is where it gets tricky


Hi, there's a thing with Shadow-CLJS that I really don't understand, that's almost reproducible all time. On my project:, if I try to watch :integration target, most of the time I get the following error:

File: /home/mauricio/.atom/packages/chlorine/repl-tooling/test/repl_tooling/repl_client/textual_representation_test.cljs:18:3
  15 |       render/txt-for-result))
  16 | 
  17 | (cards/deftest evaluate-to-text
  18 |   (async-with-clj-repl "text repr"
Encountered error when macroexpanding cljs.core/aset.
        cljs.analyzer/compiler-options (analyzer.cljc:168)
        cljs.analyzer/checked-arrays (analyzer.cljc:178)
        cljs.analyzer/checked-arrays (analyzer.cljc:174)
        cljs.core/aset (core.cljc:1043)
        cljs.core/aset (core.cljc:1041)
        clojure.core/apply (core.clj:669)
      ....big stacktrace


I just need to open this file and save it once, then it compiles fine.


the file looks rather macro heavy and no clue what they do. might expand to a bazillion forms for all I know 😛


Right you are, but not that heavier than other test files that don't cause trouble 😄


That's what's been on my mind for a while 😄


Hello all! need some help on :optimizations. I am working on an app using shadow/reagent/expo/react-native and the app works fine upon shadow-cljs release with :optimizations :simple but with :optimizations :advanced it looses some symbols names from google closure optimizations.

(defn root []
  (let [this (r/current-component)
        open-drawer  #(this.refs.drawer.openDrawer)]
The reference for this.refs.drawer.openDrawer is lost on advanced optimization. Some thoughts on how to circunvent this??


This is a pretty common problem and there are a lot of options. is my favorite, is another option people seem to like. Going a bit more extreme there is which was built specifically to address this problem. Finally you can drop down into


The point is that "dot access" breaks because the variable names change on advanced optimization and your CLJS code doesn't


(defn root []
  (let [^js this (r/current-component)
        open-drawer  #(.. this -refs -drawer -openDrawer)]


this should be all you need. don't need a library or anything. if you have externs inference turned on you should be getting a warning


@U0S3YK6HK using those libraries to fix externs issues is pretty much an anti-pattern these days and should not be used for that


TIL, thanks!


@U05224H0W tks! that works! TIL !!