Fork me on GitHub
#shadow-cljs
<
2020-03-25
>
hkrish01:03:33

Error with react-datepicker. I have been trying to use react-datepicker in my app with shadow-cljs. I installed react-datepicker and react-bootstrap, with pm. Then I required in the cljs namespace with ["react-datepicker" :as ds]. While compiling I am getting the following error: has anyone got this error before? Any hint is appreciated. Spent quite a bit of time on this.. IllegalArgumentException: No matching field found: getSourceName for class com.google.javascript.jscomp.JSError clojure.lang.Reflector.getInstanceField (Reflector.java:397) clojure.lang.Reflector.invokeNoArgInstanceMember (Reflector.java:440) shadow.build.closure/js-error-xf/fn--11865 (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) shadow.build.closure/log-warnings (closure.clj:1092) shadow.build.closure/log-warnings (closure.clj:1088) shadow.build.closure/convert-sources-simple* (closure.clj:1860) shadow.build.closure/convert-sources-simple* (closure.clj:1714) shadow.build.closure/convert-sources-simple (closure.clj:2000) shadow.build.closure/convert-sources-simple (closure.clj:1952) shadow.build.compiler/maybe-closure-convert (compiler.clj:1117) shadow.build.compiler/maybe-closure-convert (compiler.clj:1110) shadow.build.compiler/compile-all (compiler.clj:1368) shadow.build.compiler/compile-all (compiler.clj:1229) shadow.build.api/compile-sources (api.clj:255) shadow.build.api/compile-sources (api.clj:247) shadow.build/compile (build.clj:406) shadow.build/compile (build.clj:397) shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:316) shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:302) shadow.cljs.devtools.server.worker.impl/do-resource-update (impl.clj:942) shadow.cljs.devtools.server.worker.impl/do-resource-update (impl.clj:905) shadow.cljs.devtools.server.util/server-thread/fn--15324/fn--15325/fn--15333 (util.clj:285) shadow.cljs.devtools.server.util/server-thread/fn--15324/fn--15325 (util.clj:284) shadow.cljs.devtools.server.util/server-thread/fn--15324 (util.clj:257) java.lang.Thread.run (Thread.java:834)

thheller08:03:34

@hkrishnan2005 that is caused by a dependency conflict on the closure-compiler version. common if you use lein. you need to ensure that you have the version shadow-cljs wants which would be

[com.google.javascript/closure-compiler-unshaded "v20191027"]

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

Saikyun08:03:51

not sure if this is related to shadow-cljs or not, but when working with swedish letters "åäö", they end up as "???" in the repl.

Saikyun08:03:57

using the browser-repl

thheller08:03:44

and which client? its all utf-8 so if you terminal doesn't show that properly its your terminal

thheller08:03:48

$ shadow-cljs browser-repl
shadow-cljs - config: /mnt/c/Users/thheller/code/shadow-cljs/shadow-cljs.edn
shadow-cljs - connected to server
[:browser-repl] Configuring build.
[:browser-repl] Compiling ...
[:browser-repl] Build completed. (135 files, 134 compiled, 0 warnings, 6.31s)
cljs.user=> "åäö"
"åäö"

thheller08:03:55

works fine for me

Saikyun08:03:25

I tried in both emacs and the terminal.

hindol08:03:34

@saikyun What's your locale and LANG?

Saikyun08:03:49

@hindol.adhya how do I check that? 🙂 unix-noob

Saikyun08:03:07

[email protected] frontend % locale
LANG=""
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

hindol09:03:13

Okay, try setting LANG to "UTF-8" and retry.

Saikyun09:03:56

how do I do that?

hindol09:03:30

For now, % export LANG="UTF-8"

hindol09:03:49

If that works, we'll set that permanently in a different way.

Saikyun07:03:47

sadly, it didn't work

Saikyun08:03:26

now when I run locale it says that LANG="UTF-8", but I still get ??? when in the cljs-repl

hindol18:03:48

Sorry, that's all I can think of.

Saikyun05:03:24

thanks for taking the time to help either way :)

darwin13:03:56

I vaguely remember somone had issues with :refer-clojure :rename and shadow-cljs, I’m now facing an issue with :refer-clojure :only in my .clj file with macros, the file is expected to work, but fails with shadow-cljs with a stack trace originating from shadow.build.macros$load_macros, I didn’t find a relevant issue in shado-cljs github repo, just wondering if I should dig into it and create one

thheller13:03:53

no clue what you are referring to so yes create an issue or dig into it yourself 😛

darwin13:03:47

ok, thanks, will have to find a minimal repro

darwin14:03:46

ahh, I take it back, the problem is that I added clojure special form into :only, so it is not shadow-cljs problem at all, I was able to reproduce it with plain clj as well