shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
metehan 2021-05-10T05:01:42.045Z

I have a project which runs perfectly when I use watch app but when I release with release app it gives some failed to loaderrors. How can I solve such problem.

thheller 2021-05-10T07:13:34.045600Z

which shadow-cljs version is this with? I fixed a couple issues regarding $jscomp not too long ago

thheller 2021-05-10T07:14:21.045800Z

otherwise the easiest way to fix this increasing the :compiler-options {:output-feature-set :es6} or even higher :es7, :es8

thheller 2021-05-10T07:14:30.046Z

depending on how many really old browsers you need to support

thheller 2021-05-10T07:18:53.046200Z

in the older versions it was sometimes enough to delete the .shadow-cljs/builds cache

metehan 2021-05-10T23:53:35.055200Z

I had "shadow-cljs": "^2.8.51" looks like I am far behind the current version. I don't need to support any old browser so I will just start to use latest version thank you

metehan 2021-05-11T00:00:23.055400Z

using latest version and deleting builds solved my problem

metehan 2021-05-10T05:02:49.045100Z

the error can be seen here -> https://uygulama.spill.web.tr/nightly

Endre Bakken Stovner 2021-05-10T16:06:38.051400Z

Sorry if this is an inappropriate channel but I am wondering how I can debug an import error. I am using luminus with the +shadow-cljs setting. I've added d3-dag to my :npm-deps in project.clj. I've also tried installing d3-dag manually from the command line. However, when I try to require it like this:

(require '["d3-dag" :as d3])
I get the error:
[:app] Compiling ...
[:app] Build failure:
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--45167 (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/throw-errors! (closure.clj:1093)
	shadow.build.closure/throw-errors! (closure.clj:1088)
	shadow.build.closure/convert-sources-simple* (closure.clj:1843)
	shadow.build.closure/convert-sources-simple* (closure.clj:1703)
	shadow.build.closure/convert-sources-simple (closure.clj:1989)
	shadow.build.closure/convert-sources-simple (closure.clj:1941)
	shadow.build.compiler/maybe-closure-convert (compiler.clj:1082)
	shadow.build.compiler/maybe-closure-convert (compiler.clj:1075)
	shadow.build.compiler/compile-all (compiler.clj:1333)
	shadow.build.compiler/compile-all (compiler.clj:1194)
	shadow.build.api/compile-sources (api.clj:256)
	shadow.build.api/compile-sources (api.clj:248)
	shadow.build/compile (build.clj:398)
	shadow.build/compile (build.clj:389)
	shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:314)
	shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:300)
	shadow.cljs.devtools.server.worker.impl/do-resource-update (impl.clj:936)
	shadow.cljs.devtools.server.worker.impl/do-resource-update (impl.clj:899)
	shadow.cljs.devtools.server.util/server-thread/fn--48207/fn--48208/fn--48216 (util.clj:285)
	shadow.cljs.devtools.server.util/server-thread/fn--48207/fn--48208 (util.clj:284)
	shadow.cljs.devtools.server.util/server-thread/fn--48207 (util.clj:257)
	java.lang.Thread.run (Thread.java:831)
Any hints on how to start debugging this would be appreciated. The error is specific to the d3-dag package, since requiring ["react" :as r] works.

thheller 2021-05-10T16:08:08.052Z

@endrebak85 that is cased by a dependency conflict on the closure-compiler version. see https://shadow-cljs.github.io/docs/UsersGuide.html#failed-to-load

Endre Bakken Stovner 2021-05-10T16:10:16.053400Z

Thank you. I was experiencing some other weirdness too (dunno if they are due to shadow-cljs though). Will fix it and see if they disappear. Do you think these error messages might have the same cause? https://clojurians.slack.com/archives/C053AK3F9/p1620220881170500

thheller 2021-05-10T16:29:56.054Z

@endrebak85 that happens when you use a too old shadow-cljs version with jdk15+, need to upgrade shadow-cljs

🙏 1
thheller 2021-05-10T16:31:27.054600Z

cant' remember which version added jdk15 compatibility, but at least 2.11.x is likely required. current is 2.12.6