This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-05
Channels
- # announcements (7)
- # beginners (107)
- # boot (5)
- # calva (2)
- # cider (18)
- # clj-kondo (48)
- # cljs-dev (16)
- # cljsrn (2)
- # clojure (208)
- # clojure-berlin (1)
- # clojure-dev (25)
- # clojure-europe (14)
- # clojure-italy (10)
- # clojure-nl (10)
- # clojure-sg (1)
- # clojure-spec (52)
- # clojure-uk (13)
- # clojurescript (53)
- # cursive (7)
- # data-science (7)
- # datomic (4)
- # duct (1)
- # events (10)
- # fulcro (1)
- # graphql (5)
- # jobs (2)
- # kaocha (13)
- # leiningen (6)
- # off-topic (17)
- # pathom (4)
- # quil (6)
- # re-frame (52)
- # reagent (12)
- # reitit (3)
- # shadow-cljs (97)
- # spacemacs (10)
- # sql (39)
- # tools-deps (18)
- # uncomplicate (1)
- # xtdb (1)
@eag it would help to know what you actual error is? I don't see anything that would require externs?
I see an error but that would blow up in development also?
(defn mount-chart [comp]
(hc/chart Highcharts (r/dom-node comp) (clj->js (r/props comp))))
there is an extra Highcharts
that seems undefined? and should just be (defn mount-chart [comp]
(hc/chart (r/dom-node comp) (clj->js (r/props comp))))
If I do that, take out the Highcharts, I get this.
highcharts.js:271 Uncaught TypeError: Cannot read property 'series' of null
at c$jscomp$1.Chart.init (highcharts.js:271)
at c$jscomp$1.Chart.getArgs (highcharts.js:271)
at new c$jscomp$1.Chart (highcharts.js:270)
at Object.c$jscomp$1.chart (highcharts.js:270)
at Constructor.prod_inv_ui$views$mount_chart (views.cljs:14)
at Constructor.reagent$impl$component$custom_wrapper_$_componentDidMount (component.cljs:194)
at Constructor.componentDidMount (factory.js:666)
at commitAllLifeCycles (react-dom.development.js:17335)
at HTMLUnknownElement.callCallback (react-dom.development.js:150)
at Object.invokeGuardedCallbackImpl (react-dom.development.js:200)
series
is likely expected to be a prop? did you check what you are passing to it? try logging (js/console.log (clj->js (r/props comp)))
in the mount-chart
fn?
also check if you are using the correct version? you just might have a different highcharts version from the one defined in cljsjs?
Ok. It's working. Thank you for the prompts. My config variable was not dereferenced. And i don't really need the externs... Sorry about that, I got mislead by all the examples I've been reading.
Hi!
We've observed compilation failures when using the explicit (. var -field)
form inside some forms (`if`, when
, but not do
)
;; Both work
(.-ok response)
(. response -ok)
;; Works
(if (.-ok response)
true
false)
;; Fails
(if (. response -ok)
true
false))
19 | (if (. response -ok)
--------^-----------------------------------------------------------------------
Error in phase :compilation
IllegalArgumentException: no conversion to symbol
clojure.core/symbol (core.clj:596)
clojure.core/symbol (core.clj:589)
cljs.analyzer/confirm-var-exists (analyzer.cljc:849)
cljs.analyzer/confirm-var-exists (analyzer.cljc:837)
cljs.analyzer/confirm-var-exists (analyzer.cljc:840)
cljs.analyzer/confirm-var-exists (analyzer.cljc:837)
shadow.build.cljs-hacks/shadow-resolve-var (cljs_hacks.cljc:357)
shadow.build.cljs-hacks/shadow-resolve-var (cljs_hacks.cljc:142)
cljs.analyzer/resolve-existing-var (analyzer.cljc:1269)
cljs.analyzer/resolve-existing-var (analyzer.cljc:1264)
Latest (`2.8.52`) also contains the issue, unfortunately.
We've quickly tested it without shadow and it doesn't seem to break there 😞and what is the rest of the stacktrace? is this inside some other macro maybe trying to rewrite it? (eg. core.async)
hmm I found it ... trying to figure out why it happens ... looks to me like a bug in CLJS
Thank you!
I'm assuming you've already figured most of it out, but response
is a #js
object.
Using a regular CLJS map or changing the names give us the same error.
Surprisingly, running it on app.klipse.tech
doesn't seem to break things!
the bug is getting fixed in CLJS properly https://clojure.atlassian.net/browse/CLJS-3163
I get these sorts of errors after restarting shadow-cljs a few times:
{:type java.io.FileNotFoundException
:message "/home/kenny/compute_software_mono/projects/ui/src/compute/ui/login/views.cljs (Too many open files)"
:at [java.io.FileInputStream open0 "FileInputStream.java" -2]}
Typically the only way to fix it is restarting my computer. Anyone know of a better solution?which OS is that? looks like linux? maybe you are running into some kind of system limits for other reasons?
Oh. Will try killing all java. Was using a a hand-rolled lib to run multiple processes at once that could've left processes running. Switching to npm-run-all in hope that it is better at killing processes. I'm on Ubuntu. I've set that file limit pretty high.
It only ever happens with shadow-cljs. There's gotta be a shadow process still running somewhere.
Yeah... There can't be more than 60 namespaces. Guessing it's the node_modules that is the issue.
IntelliJ was the only thing holding onto .cljs things and that was just a few maven deps. e.g. /home/kenny/.m2/repository/rewrite-cljs/rewrite-cljs/0.4.4/rewrite-cljs-0.4.4.jar
ps aux | sed 1d | awk '{print "fd_count=$(lsof -p " $2 " | wc -l) && echo " $2 " $fd_count"}' | xargs -I {} bash -c {}
find -maxdepth 1 -type d -name '[0-9]*' \
-exec bash -c "ls {}/fd/ | wc -l | tr '\n' ' '" \; \
-printf "fds (PID = %P), command: " \
-exec bash -c "tr '\0' ' ' < {}/cmdline" \; \
-exec echo \; | sort -rn | head
seems nicer 😛Too late 😬 I'm sure I can reproduce it if needed. I usually only start shadow-cljs once per day. Today I restarted it a few times because I was updating deps.
I did see that SO post and tried a few of the commands in it. I don't think they gave me anything obviously wrong. Though, on one of them, it wasn't clear what the columns it was outputting meant.
Oh, now this is interesting. First time running after a restart and I got it. The only thing I've changes is my deps.
The ps
is the one that outputs two columns. Any idea what the columns mean? First one is, maybe, pid and second is open files?
ah that was what I meant, if I have a defmethod
defined in a module that I chose to lazy load later, doesn't seem to be registred here, but i'll investigate and let you know, might be something else causing the issue
@nisehl remember that the load is async so if you trigger the load and immediately call the defmulti then the code will not have loaded yet
I'm defining a specific noop fn called init
in my separate modules, I call it using lazy/load
and once it's lazy/ready?
, I consider all parts of the said module as ready, am I doing it wrong ?
(-> (lazy/load (lazy/loadable mynamespace.mymodule/init)) (.then (fn [init-fn] the-defmethod-is-ready-now))
yes I didn't past all the code but along the chain, in .then() is all the module to be considered loaded ?
Anyone have a sort of autoformatter-on-save set up to work with shadow before I hack one together myself?
yeah. true. I kinda want to do it this way so that I force other people working on my project to format in the same way. haha.
(we all use diff editors)
Hmm. So I recently switched to PopOS, which is a flavor of Ubuntu. I think this may have reset my ulimit file limit.
ulimit -n
4096
cat /proc/sys/fs/file-max
1000000
Still getting the too many open files exception...I can't figure out a way to get it to go any higher. I've tried 5 different methods and none of them let me set it higher.
I've set the limits in /etc/security/limits.conf
to 500000. I've set /etc/sysctl.conf
fs.file-max
to 1000000.
Is it prohibited to have lein and shadow-cljs in the same project? Some nice facilities are built only with lein.
you can run them separately, make shadow-cljs use lein or run shadow-cljs embedded in your lein process
@thheller thanks a lot for your answer!
This is super weird:
kenny@pop-os:~$ whoami
kenny
kenny@pop-os:~$ ulimit -Hn
4096
kenny@pop-os:~$ su kenny
Password:
kenny@pop-os:~$ ulimit -Hn
65535
I updated to PopOS 19.04 and it solved the issue. Very strange. Happy to be able to get some real work done now 🙂
Has anyone run into the issue where localhost:8021 (tests) always displays shadow-cljs - Stale Client! You are not using the latest compilation output!
?
@steedman87 either your server is caching or you changed the output files but didn't update the html accordingly