Fork me on GitHub

I am using the reagent shadow-cljs template, but when building for release, the app is not mounted (the content of is not replaced with the app content). In order to make it easier to debug, I have tried with the template alone, just building it to see if i had made a mistake somewhere, but I get the same result... So i guess there is someething wrong with the template... Is there anything wrong with my shadow-cljs.edn ?

{:lein         true
 :source-paths ["src"]
 :builds       {:app {:target     :browser
                      :output-dir "resources/public/js"
                      :asset-path "/js"
                      :modules    {:app {:entries [psw.core]}}
                      :devtools   {:after-load psw.core/mount-root}}}
 :dev-http     {3000 {:root    "resources/public"
                      :handler psw.handler/app}}}
I ran npx shadow-cljs release app please excuse my noobness :)


Also I get no message whathowever from the console, so I have no idea where to look


@thheller usability question. I have a bunch of AWS javascript lambda's that are using shadow and each one runs its own repl with it's own dependencies. Is there a good clean way to work like this? I feel like I need to build something to manage all the REPLs.


@postma.marin where is your init! fn called? assuming from your HTML somewhere?


@royalaid work like this with what?


@thheller you mean I should do something like :modules {:app {:entries [ydfg.core/init!]}}, ? because it causes that:

[markdown-to-hiccup "0.6.2"]
Invalid configuration
-- Spec failed --------------------

  {:target ...,
   :output-dir ...,
   :asset-path ...,
   :modules {:app {:entries [ydfg.core/init!]}},
   :devtools ...,
   :build-id ...}

should satisfy





my html is just this:

    <meta charset="utf-8">
    <link rel="stylesheet" href="css/site.css">
    <div id="app">
      <h1>Hello world</h1>
    <script src="/js/app.js"></script>


no. in your current setup you have a init! fn in psw.core


are you sure psw.handler/app emits that html?


sure you can change your config to call the init-fn ... but first you should figure out why it is different from dev/release in the first place


understand your setup first ... then adjust it


something appears to be calling the init! if it works in dev mode?


or does it not work at all? judging from your "when building for release" I assumed it works in dev


well there is a weird behaviour in dev mode, where I have to specify a route other than "/" the first time it is lauched for it to start, but I read that it might just be a server config issue + this trick don't work in release


so you likely just want :modules {:app {:init-fn psw.core/init!}} in your config


if a do that it causes this compile error

Invalid configuration
-- Spec failed --------------------
  {:target ...,
   :output-dir ...,
   :asset-path ...,
   :modules {:app {:entries [ydfg.core/init!]}},
   :devtools ...,
   :build-id ...}
should satisfy


you didn't do what I pasted


oh yes, my bad


@thheller thank you very much! it works ūüĎć have a nice day ūüôā

ūüĎć 4
Vít Kalisz14:01:09

I am trying wrap TextField a Material-UI component to use in my project called Orgpad. I have this minimal project here: where everything works just fine. However when doing the same in Orgpad, I get some ?dependency problem? screenshotted below, which persists even after I reduce the project to a minimal version similar to that in the example. (I am just rendering a TextField , I have commented out every other namespace - leaving just the one rendering the TextField, I have reduced shadow-cljs.edn to this:

{:source-paths ["src"]
 :dependencies [[reagent "0.9.0-rc4"]]
 :nrepl        {:port 9000}
 :builds       {:client {:target           :browser
                         :output-dir       "resources/public/js/compiled"
                         :asset-path       "/js/compiled"
                         :modules          {:main {:init-fn orgpad.client.core/init}}
                         :compiler-options {:infer-externs :auto}
                         :devtools         {:after-load orgpad.client.core/mount-root
                                            :watch-dir  "resources/public"}}}}
dependencies in package.json to this:
"dependencies": {
    "@material-ui/core": "^4.8.0",
    "create-react-class": "^15.6.3",
    "react": "^16.12.0",
    "react-dom": "^16.12.0"
I ran npm install, npm clean-install and restarted shadow-cljs) Would somebody please help me figure out why there is this problem?


@vitek.kalisz and the code? it appears that you are doing something like [foo] where foo is nil


the error you posted is not from the code you posted? (the code you posted compiles and runs fine for me)

Adam Bergman15:01:20

Hi!¬† I would be much helpful if anyone could point me in the right direction with this :)¬† I have made an new project with ‚Äúlein new luminus adambergmanio +jetty +h2 +re-frame +reitit +shadow-cljs‚ÄĚ When I try to run ‚Äúlein uberjar‚ÄĚ I get this exception:

[:app] Compiling ...
IllegalArgumentException: No matching field found: getSourceName for class
    clojure.lang.Reflector.getInstanceField (
    clojure.lang.Reflector.invokeNoArgInstanceMember ( (closure.clj:536)
    clojure.core/map/fn--5862/fn--5863 (core.clj:2742)
    clojure.core.protocols/iter-reduce (protocols.clj:49)
    clojure.core.protocols/fn--8140 (protocols.clj:75)
    clojure.core.protocols/fn--8140 (protocols.clj:75)
    clojure.core.protocols/fn--8088/G--8083--8101 (protocols.clj:13)
    clojure.core/transduce (core.clj:6884)
    clojure.core/into (core.clj:6899)
    clojure.core/into (core.clj:6887) (closure.clj:1081) (closure.clj:1077) (closure.clj:1079) (closure.clj:1077) (closure.clj:1185) (closure.clj:1170) (closure.clj:1161) (api.clj:268) (api.clj:262) (build.clj:411) (build.clj:403)
    shadow.cljs.devtools.api/release* (api.clj:350)
    shadow.cljs.devtools.api/release* (api.clj:336)
    shadow.cljs.devtools.cli/do-build-command (cli.clj:29)
    shadow.cljs.devtools.cli/do-build-command (cli.clj:26)
    shadow.cljs.devtools.cli/do-build-commands (cli.clj:51)
    shadow.cljs.devtools.cli/do-build-commands (cli.clj:40)
    shadow.cljs.devtools.cli/main/body-fn--16106--auto----16696 (cli.clj:168)
    shadow.cljs.devtools.cli/main (cli.clj:167)
    shadow.cljs.devtools.cli/main (cli.clj:134)
    clojure.core/apply (core.clj:669)
    clojure.core/apply (core.clj:660)
    shadow.cljs.devtools.cli/-main (cli.clj:221)
    shadow.cljs.devtools.cli/-main (cli.clj:219)
    clojure.lang.Var.invoke (
    user/eval140 (form-init5608872905668697635.clj:1)
    user/eval140 (form-init5608872905668697635.clj:1)
    clojure.lang.Compiler.eval (
    clojure.lang.Compiler.eval (
    clojure.lang.Compiler.load (
    clojure.lang.Compiler.loadFile (
    clojure.main/load-script (main.clj:475)
    clojure.main/init-opt (main.clj:477)
    clojure.main/init-opt (main.clj:477)
    clojure.main/initialize (main.clj:508)
    clojure.main/null-opt (main.clj:542)
    clojure.main/null-opt (main.clj:539)
    clojure.main/main (main.clj:664)
    clojure.main/main (main.clj:616)
    clojure.lang.Var.applyTo (
    clojure.main.main (


@adambergman that is caused by a dependency conflict on the closure-compiler version


shadow-cljs expects these versions but you seem to be ending up with different ones


[ "v20191027"]

   [org.clojure/google-closure-library "0.0-20191016-6ae1f72f"]
   [org.clojure/google-closure-library-third-party "0.0-20191016-6ae1f72f"]


(happens when you use deps.edn or project.clj and include conflicting dependencies)

Adam Bergman15:01:43

@thheller ah ok! thank you very for instant reply! (and for the work you are putting into shadow-cljs ^^)

Adam Bergman16:01:22

Hi again, sorry but I still have trouble fixing it. It seems that re-frame and reagent was the conflicting dependencies. At first I got this message: NPM dependency ‚Äúreact‚ÄĚ has installed version ‚Äú16.8.6" ‚Äú16.9.0‚ÄĚ was required by jar:file:/Users/adambergman/.m2/repository/reagent/reagent/0.9.0-rc3/reagent-0.9.0-rc3.jar!/deps.cljs NPM dependency ‚Äúreact-dom‚ÄĚ has installed version ‚Äú16.8.6‚ÄĚ ‚Äú16.9.0" was required by jar:file:/Users/adambergman/.m2/repository/reagent/reagent/0.9.0-rc3/reagent-0.9.0-rc3.jar!/deps.cljs [:app] Compiling ... IllegalArgumentException: No matching field found: getSourceName for class then I checked which reagent version (16.9.0) that was used in the latest re-frame version (0.11.0-rc3) and changed the re-frame to this version. Then I changed react and react-dom versions to ‚Äú16.9.0‚ÄĚ. When I run ‚Äúlein uberjar‚ÄĚ again after this I still get ‚ÄúIllegalArgumentException: No matching field found: getSourceName for class‚ÄĚ but it is not complaing on different versions or anything like that.¬† Is there some way to create a new luminus project that¬†works out of the box? Like using some version that is confirmed to work ¬† Sorry for the inconvenience, I am new to clojure(script) and just trying to get get something running :D

Adam Bergman16:01:47

I meant to say that I changed re-frame version to latest version and also changed reagent version to the version that was stated in re-frames deps.clj


reagent and re-frame have nothing to do with this


it is striclty and incompatile closure-compiler version


one of the reasons I recommend running shadow-cljs standalone (no deps.edn/project.clj) so you don't have to deal with this crap


you can just add the dependencies I pasted above to you project.clj :dependencies list

Adam Bergman16:01:42

oh ok I have no idea what I am doing ūüôā ok I just tried to get an ‚Äútemplate‚ÄĚ app up and running using luminus.

Adam Bergman16:01:10

by running standalone how would I compile it

Adam Bergman16:01:50

thanks again i will try!


maybe the luminus template is a bit out of date. I don't know any of the details there

Adam Bergman16:01:19

so i should use shadow-cljs separeate


you can use lein ... that is totally fine ... BUT then you have to sort out these kind of dependency conflicts


if you use shadow-cljs.edn the tool sorts those out for you for the most part


you can run lein deps :tree and resolve the conflicts


by either adding the :exclusions or adding the proper versions of the dependencies I pasted above

Adam Bergman16:01:08

i will try with these dependencies first,

Adam Bergman17:01:45

it worked fine with the dependencies you provided ūüôā !

ūüĎć 4