Fork me on GitHub
#shadow-cljs
<
2020-02-17
>
Gleb Posobin04:02:27

Is there a way to specify the name of the :chrome/single-file output? I want several files, each for a different extension page.

dpsutton18:02:49

just made a clone of enjoyingthe.show a webapp that uses faceapi.js to do facial analysis. Got the code here if anyone wants to see the example: https://github.com/dpsutton/howamidoing-cljs

👍 4
neupsh20:02:39

Hi, fyi: The link for "enjoyingthe.show" in the readme is invalid

dpsutton20:02:17

thanks! updated

👍 4
Aleed19:02:34

does the :web-worker configuration work for node_modules? (I have a package that expected me to configure a worker loader w webpack so wondering if that's possible with shadow-cljs)

dpsutton20:02:57

i made a project using the latest core.async. On page reload and shutting down the server it would throw async errors from shadow's tooling. Is this a known issue or should i raise a new one (i know conflicts in versions in tooling versus app are never fun 😞 )

martinklepsch21:02:37

I’m writing some async tests and whenever there’s an unhandled promise rejection crashing the script I’d expect the script to return a non-zero status code. It seems that the script returns 0 though. This is on node.

martinklepsch21:02:33

Here’s a test that demonstrates what I mean

(deftest failing-async-test
  (t/async done
           (let [e (ex-info "foo" {})
                 p1 (p/promise e)]
             (p/catch p1 (fn [x]
                           (t/is (= :a x))
                           (throw (ex-info "test" {}))
                           (done))))))

martinklepsch21:02:33

Here’s a test that demonstrates what I mean

(deftest failing-async-test
  (t/async done
           (let [e (ex-info "foo" {})
                 p1 (p/promise e)]
             (p/catch p1 (fn [x]
                           (t/is (= :a x))
                           (throw (ex-info "test" {}))
                           (done))))))

thheller21:02:22

@martinklepsch dunno about the exit code but shadow-cljs does nothing to the node process regarding uncaught exceptions. you need to set that up yourself.

thheller21:02:32

@dpsutton "page reload and shutting down the server". how are those two things related?

dpsutton22:02:31

not related. a page refresh triggers

Exception in thread "async-dispatch-4" java.lang.IllegalArgumentException: No implementation of method: :close! of protocol: #'clojure.core.async.impl.protocols/Channel found for class: nil
	at clojure.core$_cache_protocol_fn.invokeStatic(core_deftype.clj:583)
	at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:575)
	at clojure.core.async.impl.protocols$eval246$fn__247$G__235__252.invoke(protocols.clj:21)
	at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invokeStatic(ioc_macros.clj:984)
	at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invoke(ioc_macros.clj:980)
	at shadow.undertow$fn$reify__15877$fn__15997.invoke(undertow.clj:322)
	at clojure.lang.AFn.run(AFn.java:22)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at clojure.core.async.impl.concurrent$counted_thread_factory$reify__484$fn__485.invoke(concurrent.clj:29)
	at clojure.lang.AFn.run(AFn.java:22)
	at java.lang.Thread.run(Thread.java:748)
[:app] Compiling ...
[:app] Build completed. (1064 files, 1 compiled, 0 warnings, 6.11s)
^CRunning shutdown hook.
shutting down ...

dpsutton22:02:01

and control-c on the command line to kill the server yeilds

dpsutton22:02:06

Exception in thread "async-dispatch-2" java.lang.IllegalArgumentException: No implementation of method: :close! of protocol: #'clojure.core.async.impl.protocols/Channel found for class: nil
	at clojure.core$_cache_protocol_fn.invokeStatic(core_deftype.clj:583)
	at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:575)
	at clojure.core.async.impl.protocols$eval246$fn__247$G__235__252.invoke(protocols.clj:21)
	at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invokeStatic(ioc_macros.clj:984)
	at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invoke(ioc_macros.clj:980)
	at clojure.core.async.impl.ioc_macros$take_BANG_$fn__2931.invoke(ioc_macros.clj:991)
	at clojure.core.async.impl.channels.ManyToManyChannel$fn__680.invoke(channels.clj:265)
	at clojure.lang.AFn.run(AFn.java:22)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at clojure.core.async.impl.concurrent$counted_thread_factory$reify__484$fn__485.invoke(concurrent.clj:29)
	at clojure.lang.AFn.run(AFn.java:22)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "async-dispatch-5" java.lang.IllegalArgumentException: No implementation of method: :close! of protocol: #'clojure.core.async.impl.protocols/Channel found for class: nil
	at clojure.core$_cache_protocol_fn.invokeStatic(core_deftype.clj:583)
	at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:575)
	at clojure.core.async.impl.protocols$eval246$fn__247$G__235__252.invoke(protocols.clj:21)
	at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invokeStatic(ioc_macros.clj:984)
	at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invoke(ioc_macros.clj:980)
	at clojure.core.async.impl.ioc_macros$take_BANG_$fn__2931.invoke(ioc_macros.clj:991)
	at clojure.core.async.impl.channels.ManyToManyChannel$fn__680.invoke(channels.clj:265)
	at clojure.lang.AFn.run(AFn.java:22)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at clojure.core.async.impl.concurrent$counted_thread_factory$reify__484$fn__485.invoke(concurrent.clj:29)
	at clojure.lang.AFn.run(AFn.java:22)
	at java.lang.Thread.run(Thread.java:748)

dpsutton22:02:10

but 5 of those

thheller22:02:26

did you require :reload or something while the watch was running?

thheller22:02:42

can't tell what code that relates to

dpsutton22:02:08

minimal repo. all that's important is the project requires newest async

thheller22:02:44

try setting :aot false in the shadow-cljs.edn?

dpsutton22:02:15

build or toplevel?

thheller22:02:19

there is another AOT compiled core.async version included otherwise

dpsutton22:02:15

that seems to fix it. yes

dpsutton22:02:39

want me to create an issue?

dpsutton22:02:01

or have i missed some documentation somewhere?

thheller10:02:34

I'll just bump the core.async version in the next release. dunno why it messes with AOT.

thheller21:02:28

@alidcastano no, that doesn't work. no idea what webpack needs but :web-worker is intended for standalone use only (no further processing)