This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-04
Channels
- # announcements (5)
- # aws (12)
- # beginners (76)
- # boot (29)
- # cider (24)
- # circleci (9)
- # clojure (64)
- # clojure-dev (27)
- # clojure-europe (3)
- # clojure-houston (1)
- # clojure-italy (33)
- # clojure-nl (19)
- # clojure-poland (1)
- # clojure-spec (6)
- # clojure-uk (20)
- # clojurescript (103)
- # clojutre (1)
- # code-reviews (60)
- # cursive (76)
- # data-science (20)
- # datomic (20)
- # duct (58)
- # figwheel-main (4)
- # fulcro (36)
- # graphql (6)
- # kaocha (4)
- # onyx (1)
- # pathom (15)
- # quil (3)
- # re-frame (15)
- # reagent (15)
- # reitit (9)
- # remote-jobs (2)
- # rewrite-clj (16)
- # ring-swagger (7)
- # shadow-cljs (132)
- # spacemacs (12)
- # sql (5)
- # vim (9)
- # xtdb (12)
- # yada (4)
After updating to 2.8.52, when I run shadow-cljs watch app
, I get an error like this:
RejectedExecutionException: Task java.util.concurrent.FutureTask@1032943c rejected from java.util.concurrent.ThreadPoolExecutor@49a80d5a[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 306]
Deleting the .shadow-cljs
directory makes it go away, but it reappears when I restart shadow-cljs with an existing .shadow-cljs
directory. Anyone come across the same issue?
Stacktrace:
RejectedExecutionException: Task java.util.concurrent.FutureTask@1032943c rejected from java.util.concurrent.ThreadPoolExecutor@49a80d5a[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 306]
java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution (ThreadPoolExecutor.java:2063)
java.util.concurrent.ThreadPoolExecutor.reject (ThreadPoolExecutor.java:830)
java.util.concurrent.ThreadPoolExecutor.execute (ThreadPoolExecutor.java:1379)
java.util.concurrent.AbstractExecutorService.submit (AbstractExecutorService.java:112)
sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke (Method.java:498)
clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:167)
clojure.lang.Reflector.invokeInstanceMethod (Reflector.java:102)
shadow.build.async/queue-task (async.clj:11)
shadow.build.async/queue-task (async.clj:4)
shadow.build.output/flush-sources (output.clj:245)
shadow.build.output/flush-sources (output.clj:240)
shadow.build.output/flush-sources (output.clj:242)
shadow.build.output/flush-sources (output.clj:240)
shadow.build.targets.browser/flush-unoptimized! (browser.clj:654)
shadow.build.targets.browser/flush-unoptimized! (browser.clj:642)
shadow.build.targets.browser/flush-unoptimized (browser.clj:668)
shadow.build.targets.browser/flush-unoptimized (browser.clj:665)
shadow.build.targets.browser/flush (browser.clj:679)
shadow.build.targets.browser/flush (browser.clj:671)
shadow.build.targets.browser/process (browser.clj:823)
shadow.build.targets.browser/process (browser.clj:801)
clojure.lang.Var.invoke (Var.java:384)
shadow.build/process-stage/fn--14088 (build.clj:143)
shadow.build/process-stage (build.clj:140)
shadow.build/process-stage (build.clj:132)
shadow.build/flush (build.clj:423)
shadow.build/flush (build.clj:418)
shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:315)
shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:300)
shadow.cljs.devtools.server.worker.impl/eval15252/fn--15254 (impl.clj:695)
clojure.lang.MultiFn.invoke (MultiFn.java:234)
shadow.cljs.devtools.server.util/server-thread/fn--14897/fn--14898/fn--14906 (util.clj:285)
shadow.cljs.devtools.server.util/server-thread/fn--14897/fn--14898 (util.clj:284)
shadow.cljs.devtools.server.util/server-thread/fn--14897 (util.clj:257)
java.lang.Thread.run (Thread.java:748)
others have reported running into this occasionally but I have never been able to reproduce
and I have no clue how this could happen other than trying to actually interrupt a build
Right. It is certainly weird. I can certainly try to look into it, but I'm not sure where I'd even start.
do you connect a REPL before this happens? or does it happen on its own by just running shadow-cljs watch app
?
Here's a fuller terminal output:
shadow-cljs - config: /Users/eerohe/Code/ci/shadow-cljs.edn cli version: 2.8.52 node: v11.15.0
shadow-cljs - running: lein with-profile +cljs run -m shadow.cljs.devtools.cli --npm watch app
Warning: implicit hook found: lein-environ.plugin/hooks
Hooks are deprecated and will be removed in a future version.
NPM dependency "highlight.js" has installed version "^9.15.10"
"9.15.8" was required by jar:file:/Users/eerohe/.m2/repository/day8/re-frame/re-frame-10x/0.4.2/re-frame-10x-0.4.2.jar!/deps.cljs
shadow-cljs - server version: 2.8.52 running at
shadow-cljs - nREPL server started on port 50001
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
shutting down ...
shutting down ...
[:app] Build failure:
RejectedExecutionException: Task java.util.concurrent.FutureTask@7249f31f rejected from java.util.concurrent.ThreadPoolExecutor@273195bb[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 306]
java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution (ThreadPoolExecutor.java:2063)
java.util.concurrent.ThreadPoolExecutor.reject (ThreadPoolExecutor.java:830)
java.util.concurrent.ThreadPoolExecutor.execute (ThreadPoolExecutor.java:1379)
java.util.concurrent.AbstractExecutorService.submit (AbstractExecutorService.java:112)
sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke (Method.java:498)
clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:167)
clojure.lang.Reflector.invokeInstanceMethod (Reflector.java:102)
shadow.build.async/queue-task (async.clj:11)
shadow.build.async/queue-task (async.clj:4)
shadow.build.output/flush-sources (output.clj:245)
shadow.build.output/flush-sources (output.clj:240)
shadow.build.output/flush-sources (output.clj:242)
shadow.build.output/flush-sources (output.clj:240)
shadow.build.targets.browser/flush-unoptimized! (browser.clj:654)
shadow.build.targets.browser/flush-unoptimized! (browser.clj:642)
shadow.build.targets.browser/flush-unoptimized (browser.clj:668)
shadow.build.targets.browser/flush-unoptimized (browser.clj:665)
shadow.build.targets.browser/flush (browser.clj:679)
shadow.build.targets.browser/flush (browser.clj:671)
shadow.build.targets.browser/process (browser.clj:823)
shadow.build.targets.browser/process (browser.clj:801)
clojure.lang.Var.invoke (Var.java:384)
shadow.build/process-stage/fn--14088 (build.clj:143)
shadow.build/process-stage (build.clj:140)
shadow.build/process-stage (build.clj:132)
shadow.build/flush (build.clj:423)
shadow.build/flush (build.clj:418)
shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:315)
shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:300)
shadow.cljs.devtools.server.worker.impl/eval15252/fn--15254 (impl.clj:695)
clojure.lang.MultiFn.invoke (MultiFn.java:234)
shadow.cljs.devtools.server.util/server-thread/fn--14897/fn--14898/fn--14906 (util.clj:285)
shadow.cljs.devtools.server.util/server-thread/fn--14897/fn--14898 (util.clj:284)
shadow.cljs.devtools.server.util/server-thread/fn--14897 (util.clj:257)
java.lang.Thread.run (Thread.java:748)
Worker shutdown.
dunno why it works with older versions though. I didn't change anything that would affect memory issues
By the way, I also get this if I remove the :lein
key from my shadow-cljs.edn
:
[2019-09-04 12:34:47.608 - WARNING] :shadow.cljs.devtools.server.fs-watch-hawk/hawk-start-ex
ArityException Wrong number of args (0) passed to: clojure.core/juxt
clojure.core/apply (core.clj:665)
clojure.core/apply (core.clj:660)
hawk.core/watch! (core.clj:79)
hawk.core/watch! (core.clj:59)
shadow.cljs.devtools.server.fs-watch-hawk/start* (fs_watch_hawk.clj:41)
shadow.cljs.devtools.server.fs-watch-hawk/start* (fs_watch_hawk.clj:29)
shadow.cljs.devtools.server.fs-watch-hawk/start (fs_watch_hawk.clj:102)
shadow.cljs.devtools.server.fs-watch-hawk/start (fs_watch_hawk.clj:100)
clojure.lang.Var.invoke (Var.java:399)
shadow.cljs.devtools.server.fs-watch/start (fs_watch.clj:26)
shadow.cljs.devtools.server.fs-watch/start (fs_watch.clj:11)
shadow.cljs.devtools.server/start!/fn--16824 (server.clj:435)
In my shadow-cljs.edn
? None, so that's probably the issue. Maybe disregard that for now, would probably need to make more extensive changes to my shadow-cljs.edn
to eliminate Leiningen. 🙂
Learned something new in addition to finding a fix for my issue. Huge thanks once again for your help!
Just as a sanity check, I tried copying my :dependencies
and {:dev {:dependencies ,,, }}
from project.clj
into shadow-cljs.edn
wholesale and specifying :source-paths
and the issue doesn't occur.
do you maybe have additional lein plugins or ~/.lein/profiles.clj
or so adding extra deps?
Replacing my ~/.lein/profiles.clj
(which loads some plugins) with an empty map also solves the issue.
https://gist.github.com/eerohele/87a37812729f87d8b27cd9d3ca94e5e3 Made this in case someone else tries googling the same issue.
Hey! I am using shadow-cljs
and want to get integration with Emacs. Putting [cider/cider-nrepl "0.18.0"]
in the shadow-cljs.edn
file (under :dependencies
) works fine. But when I remove it there and instead paste it into user config file ~/.shadow-cljs/config.edn
it breaks. Some ideas?
In Emacs, it finds the correct Port, but after choosing that, I get error in process filter: Wrong type argument: stringp, nil
I have no clue about the emacs side of things. you can run shadow-cljs clj-repl
and then (
to verify it is actually on the classpath
the client is 0.22 and cider-nrepl is 0.18. No clue what it should be. Bump the dep to [cider/cider-nrepl "0.22.2"]
update that. can't remember which version I added support for ~/.shadow-cljs/config.edn
. it may be too old for that
i'm getting compile errors from an ns
:require
form which works in shadow-cljs node-repl
with (require <...>)
. the form is:
["google-libphonenumber"
:refer [PhoneNumber]
:rename {PhoneNumber.CountryCodeSource ccs
PhoneNumberFormat pnf
PhoneNumberUtil pnu}]
am i doing something obviously wrong ?Now it's connecting and asking about the build (`:app`). After that I don't get a cljs-repl
tho and can't eval buffers. In the clj-repl
is the warning
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.5.0-SNAPSHOT (package: 20190618.716) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.[:app] Build completed. (1647 files, 1618 compiled, 0 warnings, 49,33s)
pasted.@mccraigmccraig this isn't allowed PhoneNumber.CountryCodeSource ccs
and should never work
oh, lol, ok
------ WARNING #3 - -----------------------------------------------------------
Resource: er_model/util/phone_number.cljc:3:7
variable pnu is undeclared
--------------------------------------------------------------------------------
------ WARNING #4 - -----------------------------------------------------------
Resource: er_model/util/phone_number.cljc:8:200
variable ccs is undeclared
--------------------------------------------------------------------------------
------ WARNING #5 - -----------------------------------------------------------
Resource: er_model/util/phone_number.cljc:186:83
variable pnf is undeclared
--------------------------------------------------------------------------------
so it's complaining about the aliases in the ns
form
(ns er-model.util.phone-number
(:require
[plumbing.core :refer [assoc-when defnk]]
#?(:cljs ["google-libphonenumber"
:refer [PhoneNumber]
:rename {CountryCodeSource ccs
PhoneNumberFormat pnf
PhoneNumberUtil pnu}]))
#?(:clj
(:import
[com.google.i18n.phonenumbers
PhoneNumberUtil
PhoneNumberUtil$PhoneNumberFormat
Phonenumber$PhoneNumber
Phonenumber$PhoneNumber$CountryCodeSource])))
hmm. i got rid of the wrong :rename
, but i'm still getting errors relating to the other :rename
symbols
i'll try just getting rid of all the :rename
s and see how that goes
(ns demo.cljc
(:require
#?(:cljs ["google-libphonenumber"
:refer [PhoneNumber]
:rename {CountryCodeSource ccs
PhoneNumberFormat pnf
PhoneNumberUtil pnu}])))
(js/console.log ccs pnf pnu)
yeah, it works fine for me in the node-repl... and ccs
is an attribute of PhoneNumber
which is where i was going with the accidentally working PhoneNumber.CountryCodeSource
thing
just doesn't compile from the .cljc
cli version: 2.8.39 node: v12.5.0
and not using lein or deps directly
odd. the PhoneNumberFormat
and PhoneNumberUtil
objects don't seem to be there when compiling, although they do when running the repl
but the PhoneNumber
object is there in both cases
finally got it to work @thheller , and ditched the .cljc in favour of two small equivalent .cljs and .clj files - much easier to read
i'm not sure why, but in the google-libphonenumber lib the PhoneNumberUtil
and PhoneNumberFormat
don't work in the :require
but are accessible as properties of the default export - https://gist.github.com/mccraigmccraig/1e8dafda6d86ea6ae0018b492992ee40
oh, how ?
:as
sets up a namespace alias. so you should NOT be using (.-PhoneNumberUtil phone-number)
and use the correct phone-number/PhoneNumberUtil
instead
ok, cool - i initially tried to :refer [PhoneNumber PhoneNumberUtil PhoneNumberFormat]
but that lead to nil
s for PhoneNumberUtil
and PhoneNumberFormat
let me try again, now i've got it all simplified
i'm using :refer
in lots of other namespaces without issue...
never used :rename
before, but i was trying to duplicate what a cljsjs lib was doing
ok, well now the :refer
works fine, so i have no idea what was causing my issue before
i'm sorry if i wasted your time
yep, this compiles and tests pass now: https://gist.github.com/038776041d6d49e27bb6a7536bd8baf2
:rename
should work fine except for the Thing.X
so a dot is technically questionable
I'm trying to use highcharts to create a reagent component. I think I'm having trouble with an Extern, I can't get it to work. The example I followed uses cljsjs and obviously works here.
https://ingesolvoll.github.io/posts/2018-12-04-revisited-how-to-use-a-charting-library-in-re-frame/
I added :compiler-options {:infer-externs :auto}
to my shadow-cljs.edn
But the mount-chart function blows up with an undefined argument. Highcharts
How can I make that symbol stick ?
(ns prod-inv-ui.views
(:require
[reagent :as r]
...
["highcharts" :as hc]))
(defn mount-chart [comp]
(hc/chart Highcharts (r/dom-node comp) (clj->js (r/props comp))))
;; with cljsjs
;; (defn mount-chart [comp]
;; (.chart js/Highcharts (r/dom-node comp) (clj->js (r/props comp))))
(defn update-chart [comp]
(mount-chart comp))
(defn chart-inner []
(r/create-class
{:component-did-mount mount-chart
:component-did-update update-chart
:reagent-render (fn [comp] [:div])}))
(defn chart-outer [config]
[chart-inner @config])