This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-30
Channels
- # babashka (46)
- # beginners (234)
- # bristol-clojurians (4)
- # cider (7)
- # clj-kondo (39)
- # cljdoc (8)
- # cljs-dev (10)
- # cljsjs (10)
- # cljsrn (24)
- # clojure (84)
- # clojure-brasil (7)
- # clojure-europe (12)
- # clojure-germany (4)
- # clojure-italy (3)
- # clojure-nl (41)
- # clojure-spec (17)
- # clojure-uk (66)
- # clojurescript (64)
- # conjure (161)
- # cursive (12)
- # data-science (45)
- # datomic (20)
- # devops (11)
- # docker (2)
- # duct (9)
- # events (7)
- # figwheel (1)
- # figwheel-main (20)
- # fulcro (32)
- # graalvm (5)
- # helix (82)
- # jackdaw (9)
- # jobs-discuss (19)
- # kaocha (11)
- # local-first-clojure (1)
- # malli (6)
- # meander (3)
- # nrepl (12)
- # off-topic (2)
- # other-lisps (15)
- # pathom (14)
- # rdf (6)
- # re-frame (8)
- # reactive (1)
- # reagent (5)
- # reitit (4)
- # rum (3)
- # shadow-cljs (77)
- # spacemacs (3)
- # sql (9)
- # test-check (31)
- # tools-deps (13)
- # vim (62)
- # xtdb (18)
Regarding running just one test with shadow-cljs. Thanks @wxitb2017 and @thheller for the help yesterday! In the end I built upon with Lucy’s code and added the functionality to provide several substrings that the test is matched against. I put the code in a gist in case it’s of use to someone else: https://gist.github.com/johesoman/16d765d158e0018ed20f9aafc6d4501f
@johesoman I made a library awhile ago for running a single test in cljs (with fixtures). Maybe you’ll find it useful? https://github.com/knubie/cljs-run-test
Very cool! Thanks 🙂
the new shadow-cljs release 2.8.110
adds some options to the :node-test
target output
Awesome! Thank you for being so responsive 🙂
what's a good way to diagnose an error that only occurs when --debug
is not passed during app release?
btw why does shadow-cljs check reports cljs.core.PersistentArrayMap expressions are not callable
as a warning?
@chris358 --debug
also turns on :pseudo-names
which still renames everything but uses longer names that are less likely to clash with anything
so if your app has issues without that it is likely that you maybe have something in the page that defines a global variable or so that then clashes with the CLJS code
one common issue in the past for example is google analytics that creates
that the closure compiler would also use unless you had externs telling it not to
but can still happen. js->clj
is also known to cause issues so if you use that with a lot of JS data that can be another cause
interesting, thanks for the pointers!
it started happening after i slurped in a few new libraries so a global name clash could indeed be the cause.
I'm working on my application, using shadow-cljs, with the bootstrap cljs support ... And if I serve the index.html via my own server (instead of the embedded shadow-cljs dev http server), I see an error from (I think) the bootstrap cljs stuff trying to load resources over a websocket. But I can't exactly see what it is trying to do or request - is there any advice on how I should debug this? It's perplexing, but if these resources fail to load, my bootstrap cljs eval stuff stops working.
just look at the browser console. it should be making regular XHR requests to get the files.
I am looking at the console. It isn't totally evident what is being done. Here, for example, is the error from the console:
Uncaught SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at Transit$JSONUnmarshaller.reader.JSONUnmarshaller.unmarshal (reader.js:39)
at Transit$Reader.reader.Reader.read (reader.js:59)
at Object.cognitect$transit$read [as read] (transit.cljs:137)
at Object.shadow$cljs$bootstrap$browser$transit_read [as transit_read] (browser.cljs:23)
at .XhrIo.G__63340 (browser.cljs:33)
at goog.net.XhrIo.goog.events.EventTarget.fireListeners (eventtarget.js:285)
at Function.goog.events.EventTarget.dispatchEventInternal_ (eventtarget.js:383)
at goog.net.XhrIo.goog.events.EventTarget.dispatchEvent (eventtarget.js:196)
at .XhrIo.onReadyStateChangeHelper_ (xhrio.js:871)
Ah, no, I think it's because I don't understand the ... I'm not sure the right term, I'm not sure how the paths are constructed.
So it's asking for the resource (I think): http://localhost:8098/bootstrap/index.transit.json
so you are on http://localhost:8098
Ah perfect, let me see if I can do it that way instead of by adding another route on the server ...
the default is just /bootstrap
just config :path "/js/bootstrap"
if thats the dir you are putting the files in currently
@thheller Thank you so much. I don't know how many hours that would have taken me to figure out.
hi, when I run shadow-cljs in a particular project it gives "java heap memory.." error on windows. how can i increase the memory limit
like this
Exception in thread "async-thread-macro-1" java.lang.OutOfMemoryError: Java heap space
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetPublicMethods(Unknown Source)
at java.lang.Class.privateGetPublicMethods(Unknown Source)
at java.lang.Class.getMethods(Unknown Source)
at clojure.lang.Reflector.getMethods(Reflector.java:498)
at clojure.lang.Reflector.invokeNoArgInstanceMember(Reflector.java:436)
at shadow.cljs.devtools.server.fs_watch_jvm$poll_changes.invokeStatic(fs_watch_jvm.clj:17)
at shadow.cljs.devtools.server.fs_watch_jvm$poll_changes.invoke(fs_watch_jvm.clj:16)
at clojure.core$map$fn__5866.invoke(core.clj:2753)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.RT.seq(RT.java:535)
at clojure.core$seq__5402.invokeStatic(core.clj:137)
at clojure.core$apply.invokeStatic(core.clj:660)
at clojure.core$mapcat.invokeStatic(core.clj:2783)
at clojure.core$mapcat.doInvoke(core.clj:2783)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at shadow.cljs.devtools.server.fs_watch_jvm$watch_loop.invokeStatic(fs_watch_jvm.clj:46)
at shadow.cljs.devtools.server.fs_watch_jvm$watch_loop.invoke(fs_watch_jvm.clj:33)
at shadow.cljs.devtools.server.fs_watch_jvm$start$fn__7286.invoke(fs_watch_jvm.clj:77)
at clojure.core.async$thread_call$fn__3186.invoke(async.clj:484)
at clojure.lang.AFn.run(AFn.java:22)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
@johesoman I made a library awhile ago for running a single test in cljs (with fixtures). Maybe you’ll find it useful? https://github.com/knubie/cljs-run-test
Does (js/require …)
work with shadow to require local .js
files or can I only require them in the namespace?
@m373h4n how much ram does you machine have? you can tune the memory settings via :jvm-opts ["-Xmx2G"]
(for max 2GB ram) in top level shadow-cljs.edn
. need to configure via project.clj/deps.edn if you use those.