This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-23
Channels
- # announcements (16)
- # asami (4)
- # babashka (49)
- # beginners (70)
- # calva (25)
- # clojars (3)
- # clojure (40)
- # clojure-europe (82)
- # clojure-france (15)
- # clojure-gamedev (16)
- # clojure-nl (2)
- # clojured (7)
- # clojurescript (13)
- # conjure (11)
- # cursive (4)
- # data-science (12)
- # datalevin (2)
- # figwheel-main (5)
- # gratitude (5)
- # honeysql (5)
- # hyperfiddle (4)
- # jobs (4)
- # joyride (3)
- # lsp (10)
- # malli (2)
- # missionary (14)
- # nbb (2)
- # off-topic (3)
- # pathom (16)
- # rdf (5)
- # releases (4)
- # sci (35)
- # shadow-cljs (16)
- # tools-deps (22)
- # xtdb (7)
Any idea why the shadow status pages would be broken? I’ve seen Unknown, waiting for recompile.
on the /build/xxx
pages for the shadow server since at least release 2.15.2. I just tried upgrading to 2.19.4 today and still see the same page even if I cause the build to recompile by updating a watched file.
@jatkin the "unknown" state is shown when the UI is loaded after the build finished compiling. since it wasn't around to receive the build result. the next compilation should show the result. dunno why you have no buttons though?
You can see in the middle a compiler error appear. But the shadow build page doesn’t react. It could be down to how I’m starting the server.
(shadow.cljs.devtools.server/start!)
(shadow.cljs.devtools.api/watch build-id)
(shadow.cljs.devtools.api/nrepl-select build-id)
(shadow.cljs.devtools.api/repl build-id)
@jatkin this is an ancient version of shadow-cljs. the UI looks very different nowadays, so can't say what is going on. definitely try upgrading first. the starting is fine although api/nrepl-select
and api/repl
do the same thing. so calling both seems like a mistake.
I'm trying to build a library that will be used from node, is there a way to include static assets in the library? I've currently got a (fs.readFileSync (str "resources/" filename))
call, but it's looking at the "resources" directory of the project where it's used, as opposed to the "resources" directory in the library itself.
@winsome there is no io/resource
equivalent since node doesn't have a classpath. but you control the library and the files that come with it. you can use the special js/__dirname
to get the directory of the executing file. so just (path/resolve js/__dirname "foo.txt")
would give you the full path in your library which you can then read
this is the package https://github.com/thheller/shadow-cljs/tree/60d071ad968465ad69c2bef3ba64ff056ce09850/packages/shadow-cljs and this is the file it reads https://github.com/thheller/shadow-cljs/blob/60d071ad968465ad69c2bef3ba64ff056ce09850/packages/shadow-cljs/cli/default-config.edn
the .js file is also in the cli folder. you can look at the node_modules/shadow-cljs
package
Thanks, that's a promising approach. When I run (path/resolve js/__dirname)
from the repl in my.namespace
I get "/absolute/path/to/my/proj/root"
. However, when I wrap it in a function:
(defn read-resource [filename]
(println (path/resolve js/__dirname)))
I get "/abolute/path/to/my/proj/root/.cljs_node_repl/.cljs_node_repl/my/namespace"
.