Fork me on GitHub

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.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.


there should be a force compile option


" still see the same page". that screenshot is not from the latest version?


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.


Is there a sort of io/resource equivalent in cljs land?


@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


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".


I guess you are not using shadow-cljs? js/__dirname yields the wrong folder given how the regular CLJS repls handle file loading


hmm, no, not for the library. I might re-evaluate that decision though if it enables this.