This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-12-23
Channels
- # adventofcode (135)
- # announcements (9)
- # babashka (27)
- # beginners (97)
- # bristol-clojurians (8)
- # calva (7)
- # chlorine-clover (1)
- # cider (3)
- # clara (16)
- # clj-kondo (9)
- # cljdoc (137)
- # clojars (4)
- # clojure (110)
- # clojure-europe (118)
- # clojure-taiwan (8)
- # clojure-uk (19)
- # clojurescript (30)
- # conjure (6)
- # cryogen (32)
- # datomic (11)
- # depstar (1)
- # duct (4)
- # emacs (6)
- # fulcro (73)
- # graalvm (9)
- # keechma (7)
- # leiningen (16)
- # luminus (1)
- # malli (35)
- # meander (3)
- # off-topic (45)
- # pathom (1)
- # pedestal (2)
- # re-frame (3)
- # reagent (31)
- # reitit (2)
- # reveal (17)
- # shadow-cljs (34)
- # tools-deps (11)
- # xtdb (14)
Hello, How can I conditionally use different :source-paths for dev and release? thanks.
@kimi.im with shadow-cljs.edn you can't. I consider this an anti-pattern that should be avoided so its not supported out of the box. you can do it when using deps.edn or project.clj if you really need to
then I should use two different files in the same source path for dev and prod? Is that ok?
this is usually an anti-pattern in shadow-cljs because it does things differently then other tools. so the problem that this pattern is trying to fixed is already fixed. see https://code.thheller.com/blog/shadow-cljs/2018/02/08/problem-solved-source-paths.html
Hi, the REPL problem we discussed occured to me right now and I noticed the following output in browser console:
the bug where requires are lost, occurs sometimes
[reposting the original report] Hi, it happens to me quite frequently (several times every day) that while doing changes in the code, Shadow-cljs REPL stops working correctly and I have to restart Shadow to make it working again. [4:09 PM] For instance, I get the following in Cursive nREPL:
(clojure.string/join ["ab" "cd"])
Timeout while waiting for result.
[4:10 PM] And shadow-cljs outputs this into console:
[2020-12-16 16:07:58.625 - WARNING] :shadow.cljs.devtools.server.util/handle-ex - {:msg {:op :cljs-load-sources, :sources [[:shadow.build.classpath/resource "cljs/spec/gen/alpha.cljs"] [:shadow.build.classpath/resource "cljs/spec/alpha.cljs"] [:shadow.build.classpath/resource "cljs/repl.cljs"] [:shadow.cljs.repl/resource "cljs/user.cljs"]], :call-id 6, :from 71}}
ExceptionInfo no output for id: [:shadow.cljs.repl/resource "cljs/user.cljs"] {:resource-id [:shadow.cljs.repl/resource "cljs/user.cljs"]}
shadow.build.data/get-output! (data.clj:197)
shadow.build.data/get-output! (data.clj:193)
shadow.cljs.devtools.server.worker.impl/fn--15184/fn--15187 (impl.clj:813)
clojure.core/map/fn--5866 (core.clj:2753)
clojure.lang.LazySeq.sval (LazySeq.java:42)
clojure.lang.LazySeq.seq (LazySeq.java:51)
clojure.lang.RT.seq (RT.java:535)
clojure.core/seq--5402 (core.clj:137)
clojure.core.protocols/seq-reduce (protocols.clj:24)
clojure.core.protocols/fn--8146 (protocols.clj:75)
clojure.core.protocols/fn--8146 (protocols.clj:75)
clojure.core.protocols/fn--8088/G--8083--8101 (protocols.clj:13)
[4:10 PM] Any idea what could be causing this or how I could debug where is the problem?
[4:12 PM] Also, all previous requires are lost when this happens. So for instance, I run the following code before:
(require '[orgpad.client.db.get :as db-get])
=> nil
I can use functions from db-get perfectly fine. After this, I can't call them and I get this error in REPL:
------ WARNING - :undeclared-ns ------------------------------------------------
Resource: <eval>:1:2
No such namespace: db-get, could not locate db_get.cljs, db_get.cljc, or JavaScript source providing "db-get" (Please check that namespaces with dashes use underscores in the ClojureScript file name)
--------------------------------------------------------------------------------
------ WARNING - :undeclared-var -----------------------------------------------
Resource: <eval>:1:2
Use of undeclared Var db-get/latest-editor
--------------------------------------------------------------------------------
please open a github issue if you want to get any kind of progress on this. there is far too much going on in slack for me to keep track of it all.
ok, I will do that 🙂
I do remember this now but still don't have a clue what is going on and also still can't reproduce it
seems similar to this maybe https://github.com/thheller/shadow-cljs/issues/788
Seems to be related, I will put it there
This might be a super dumb question but I'm not familiar with frontend. I'm using reagent with shadow-cljs, when I do shadow-cljs release
should I be able to serve the app just from my browser by opening index.html
or will I always need a webserver?
you'll need a webserver. in that index.html will be a reference to your js bundle that the browser will attempt to fetch. without a webserver that fetch will fail
thats not entirely true. you can load it directly from the filesystem but you are going to be limited in what you are allowed to do since browsers restrict some stuff if loaded from disk
i thought github pages and s3 both can do this. that yep meant those things will work? also, netlify makes this amazingly easy
haha didn't see the "can't". just read "can". sorry. yes of course those are fine.
hello, I'm trying to use https://github.com/kunukn/react-collapse imported like #?(:cljs ["@kunukn/react-collapse" :default Collapse])
but when it's rendered this happens:
ERROR [com.fulcrologic.fulcro.react.error-boundaries:31] - Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
first time I've run into an error like this, not sure if there's something special about importing this module into shadow-cljs?is there some rule for when that needs to be done? I see export default Collapse
in the library, so I thought it'd be a default export
Yeah, what is the rule? I usually have to make trial and errors haha