Fork me on GitHub

Hi Thomas, everyone. I'm trying to use @date-io/moment in conjunction with @material-ui/pickers as described at (except via cljs). When I :require ["@date-io/moment" :default MomentUtils], the cljs repl tells me (undefined? MomentUtils) => true. MomentUtils seems to be built from a TypeScript export default class. The js rendition looks like var MomentUtils = (function () { function MomentUtils (_a) {...}; ...; return MomentUtils; }()); module.exports = MomentUtils


Other js libs are coming across fine. Is there something about the way MomentUtils is implemented which causes shadow-cljs to leave it undefined?


@clojure475 no it is related to default exports. They only work when the code is actually shipped as ESM but most of the time it is shipped as pre-compiled CommonJS. see the section about default exports here


most likely you just need ["@date-io/moment" :as MomentUtils]


thank you!


naturally I've now gone down an adjacent rabbit hole


yeah it is an annoying situation currently. all currently released versions of webpack have a sort of hack to cheat CommonJS<->ESM interop so it sort of works in webpack


but webpack5 will be removing that hack


so things should become cleaner in the future


I'm pretty sure I tried :refer [MomentUtils], but might not have tried :as


thanks for all your incredible work; I'm fiddling with juxt/tick now... and hand-shimming js-joda in the spirit of shadow-cljsjs... how do we get ourselves into these situations!?


I wish those shims weren't necessary but mixing cljsjs and npm is a recipe for disaster so you have to pick one and I went with npm


rightly so


hi I have just installed shadow cljs and expo and I'm truing to run a project, have anybody faced such error?

Ī» shadow-cljs watch app
shadow-cljs - config: D:\Dev\clojure\rn-rf-shadow\shadow-cljs.edn  cli version: 2.8.50  node: v10.9.0
shadow-cljs - starting via "clojure"
Exception in thread "main" -A:dev (The system cannot find the file specified)
        at java.base/ Method)
        at java.base/
        at java.base/<init>(
        at java.base/<init>(
        at clojure.lang.Compiler.loadFile(
        at clojure.main$load_script.invoke(main.clj:274)
        at clojure.main$script_opt.invoke(main.clj:336)
        at clojure.main$main.doInvoke(main.clj:420)
        at clojure.lang.RestFn.invoke(
        at clojure.lang.Var.invoke(
        at clojure.lang.AFn.applyToHelper(
        at clojure.lang.Var.applyTo(
        at clojure.main.main(


I have intuition that I have this error because I work on Windows and I made a trick to use clojure, by default I has only clj in console.


@titov on windows it is expected that you are using the "official" windows distribution. see


@thheller yeah I've just wanted to write that my approach was wrong, for those who will have this error in future don't follow my path don't install clojure with choco and don't create copy of clj.bat with name cljure.bat, use developers instructions


I wasn't aware there are other approaches. If there are other solutions in other package managers I can add some kind of detection


But it does not work properly as I understood it only gives clj without clojure


1.6? that seems extremely old?


deps.edn didn't even exist back then so that seems like an entirely different thing?


idk, definitely I'm not going to use it heh, the author of choco package should update his module


just don't use deps.edn. then you don't have to deal with any of this and just let shadow-cljs handle everything šŸ˜›


Ok, I have just launched rn-rf-shadow project on my phone, imma play with it šŸ˜„


how can I connect to REPL server of my app?