Fork me on GitHub

@its.ramzi If I were you I would write a document with more details, like the purpose, whether or not it's open source, etc


What's wrong with this: (for [n control-panel-functions-list][:option "Add Node"])


console says is not ISeqable


for those using hiccup, do you use an extra html formatter?


Yes, but does a minifier to clutter that even more count?


Hi there. Just wondering why when I go to build a project (quick start) it sees code that is COMMENTED OUT.


"WARNING: string-textarea1 at line 157 is being replaced at line 209


.is thrown even if I comment out either or both of the lines!


Answer: In addition to the core.cljs file in the source folder, I also had a older version name core__V3,1[etc].cljs, and for some reason I guess the build was picking up that file instead of the core.cljs file. Strange.


It worked after I moved that older-version file to another folder.


...but why would it ignore core.cljs in favour of a more oddly named file?


@factorhengineering It will just compile all the files. 'Strange' is not something the compiler knows about.


@cjmurphy Compiling all files present makes so much more sense that selecting one and the 'wrong' one at that. Thanks.


I saw no sign of it having used two completely separate and similar files, though. I'm surprised there were no errors or noticeable odd behaviour with two things trying to manipulate the DOM in different ways. I guess I just blinked through the effects of the 1st and saw the effects of the 2nd.


New question: How do I prevent println from printing to the browser console?


I commented out (enable-console-print!), but the println commands littered throughout my code still work and go to the console!


looking at the source of enable-console-print!, you could probably call (set-print-fn! nil) and (set-print-err-fn! nil) manually


odd that there isn't a corresponding disable-console-print! builtin though


hi. how do i connect to a shadowcljs repl?


npx shadow-cljs cljs-repl main works for me, where main is a build defined in shadow-cljs.edn


dunno if you are using luminus or not


No, but I think you need to kill whatever is running at 9631, which is most likely left around from last time you started 'it' up.


9631 is occupied by shdow-cljs watch <build-id>


i have to run shadow-cljs watch <build-id> first before cljs-repl <build-id>


that's what confuses me

Justin Duncan13:07:22

are you using emacs with cider?


Hi, I'm hitting an invalid arity error using apply with more than 21 args here: The function I'm applying to is a library function so I don't have control over wether it has attached metadata. Given that I'm a Clojure newbie, after a quick eyeball of that function, doesn't that rest arg need to be a var-arg (`... & rest`) Though I notice that the protocol is also done without a var-arg so maybe this is intentional for reasons that I do not understand. Do I need to manually chunk the args in 21 sized pieces in order to use apply?


20 args is the current cap yes


What is the reason for not supporting var-args?


it is supported. just not past 20


its a limitation in the compiler. there are some open issues regarding that.


Right, ok.


its just rather rare that this is an issue so nobody has worked on it

👍 4

Is there a way to reuse fspec in clojurscript? the only way to spec functions in clojurescript seems to use fdef but that can’t take fspec defined somewhere else as an argument. My goal is to define a function spec in one place and re-use it for all functions that have the same function spec. This can be done in clojure the following way (I believe):

(def n->n-fn-spec (s/fspec :args (s/cat :n number?) :ret number?))

(s/def add5 n->n-fn-spec)
(defn add5 [n] (+ n 5))

(s/def add6 n->n-fn-spec)
(defn add6 [n] (+ n 6))


@talgiat ClojureScript has fspec can you be more clear about what's not working?


the example I posted is not working with instrument


Looking at clojurescript fdef code ( it adds the fn-sym to specedvars atom that is used with instrument. This is not the case in the clojure spec code where (I believe) the example I pasted above works with instrument


hi guys i am having trouble doing advanced compilation for my project I am using and i am able to compile it with :simple optimization but when i put :advanced i get

TypeError: c.vd is not a function
I feel like i am missing some compiler option in order to make :advanced work. The jar comes with deps.edn that have :foreign-lib description in it i am not sure what to do? How would you approach this? i wouldn't want to use shadow-cljs just yet as i want to understand compiler more and not get stuck in the future on this I am using clj cli, deps and figwheel main template this is my prod.cljs.edn
{:main routes.core
 :output-to "resources/public/cljs-out/dev-main.js"
 :output-dir "resources/public/cljs-out/out"
 :asset-path "cljs-out/out"
 :optimizations :advanced
 :closure-defines {goog.DEBUG false}
 :pretty-print false
 :infer-externs true
 {:externs-validation :off :non-standard-jsdoc :off}
 :externs ["react/externs/react.js"]}


Probably externs cannot be inferred for all the calls you're making from your code to foreign-libs. Try adding this on top of one of the namespaces where you're doing interop and see if you get any warnings (set! *warn-on-infer* true)


You can also set :pseudo-names compiler option to true to see more clearly which part of your code is failing with advanced optimizations


omg it helped


thank you @valtteri you are the best


turns out i was not interopping properly. fixed that and it worked


Cool! I'm glad you found the issue.


totally new to cljs, I am following a tutorial <>, running the command in a remove server w/o X11, after I compiled by running

clj --main cljs.main --compile hello-world.core --repl

I was able to load the page with GUI browser locally using the IP address. In the console, it also said there was an option to turn off launching browser by passing REPL option :launch-browser false, but where and how shall I config this option?


I without passing the :launch-browser false option, I am not able to get to the REPL or see the Hello World output. Please help


you can pass that option with -ro


clj --main cljs.main --help for more info


@talgiat did you actually confirm that works in the Clojure?


I thought fdef was needed for instrument to work

Alex Miller (Clojure team)18:07:29

in the clojure impl (not sure about cljs) s/fdef is just an s/def where the key in the registry is a symbol, instead of a keyword


@dnolen thanks! But I tried the following

clj --main cljs.main --compile hello-world.core --repl -ro {:launch-browser false}
it did not work. I tried to find out what "edn string" was (as suggested by the --help output).


@prodt90 the help string is pretty clear about the arg order


-ro can't come last


I would read through it at least once


@talgiat post your minimal failure into a ticket - should be a relatively easy fix


@alexmiller thanks that's helpful


@prodt90 also that edn string must be in double quotes


are you on Ubuntu?


Yes, it is on Ubuntu.


Here is what I tried: none of them worked. clj --main cljs.main -ro ":launch-browser false" --compile hello-world.core --repl clj --main cljs.main -ro {:launch-browser "false"} --compile hello-world.core --repl clj --main cljs.main -ro {":launch-browser false"} --compile hello-world.core --repl


clj --main cljs.main -ro {:launch-browser false} --compile hello-world.core --repl Execution error at cljs.cli/repl-env-opts-opt (cli.clj:229). EOF while reading Full report at:


clj --main cljs.main -ro "{:launch-browser false}" --repl worked for me


Oh yeah, this time it did not give me error, also the page loaded but on the remote server where the command was runnng, it did not return me a REPL. also there was no "hello world" printed out.


This is what I ran on the Ubuntu server: clj --main cljs.main -ro "{:launch-browser false}" --compile hello-world.core --repl it has been just hanging on the terminal "Waiting for browser to connect to http://localhost:9000 ..."


I even tried using text terminal on remote server to connect to localhost:9000, which loads the HTML successfully, but still no REPL for me.


@prodt90 we don't test with a remote server so who knows what issues are involved here - did you try locally?


ok. let me try


Anyone here using Tsickle ( to get better Closure advanced compilation for JS dependencies?


@dnolen I tried to use a server to run the command clj --main cljs.main -ro "{:launch-browser false}" --compile hello-world.core --repl It did not return Hello World, unless I open a GUI browser on the same machine, Waiting for browser to connect to http://localhost:9000 ... Hello World! ClojureScript 1.10.516 cljs.user=> (+ 3 5)


I.e., a text browser failed to trigger opening the REPL, . Those seemed to me at lease two bugs involved.


I am simply trying to follow the simpliest tutorial in the world to learn cljs tihs afternoon.


what do you mean by text browser?


that most probably doesn't execute js so no chance of it working


ok. I see. But is there a way to go directly to the repl once compiled?


To keep things simple, probably best to use the most normal setup that cljs was intended for. That wouldn't be remote servers and text browsers. It'd be Chrome or FF on a normal PC with a GUI.


I expect the command I run would say hello world and give me a repl, if I use :launch-brower false.


Clojurescript needs a javascript VM in order to run and do anything. Commonly that JSVM is in a (normal modern) browser. I think it can also be done via Node.js. But you might need to follow instructions or a tutorial that's meant specifically for that.


@prodt90 if you don't want a browser use the Node repl w/ -re node


otherwise go w/ the flow use Chrome and do it locally


for the Node REPL to work you must have Node.js installed first


ok. thanks for the tips, yeah, that is very helpful. the problem I met is actually no big deal, I need to keep things simple like you said.


Anyone know if it’s possible to get a handle to the object at compile-time?