Fork me on GitHub
#shadow-cljs
<
2022-06-04
>
Benjamin08:06:41

no source by id: [:shadow.build.classpath/resource "benjamin/lawnmower/core.cljs"]
{:id [:shadow.build.classpath/resource "benjamin/lawnmower/core.cljs"]}
ExceptionInfo: no source by id: [:shadow.build.classpath/resource "benjamin/lawnmower/core.cljs"]
	shadow.build.data/get-source-by-id (data.clj:172)
	shadow.build.data/get-source-by-id (data.clj:169)
	shadow.build.compiler/remove-dead-js-deps/remove-fn--15466/fn--15467 (compiler.clj:1225)
	clojure.core/complement/fn--5737 (core.clj:1455)
	clojure.core/filter/fn--5962 (core.clj:2834)
yo I don't get why I get this error

Benjamin09:06:32

ah maybe this happens when there is a read error in the file

thheller16:06:18

no, it should never get to that point even with errors in any file

thheller16:06:25

dunno why you'd get that though

thheller16:06:34

maybe you are doing something weird in a macro or build hook or so?

Benjamin14:06:15

wierd. It seemed to go there when there where read errors

thheller16:06:09

this is long after compilation so read errors would have shown up way earlier?

Benjamin17:06:32

Hm. It did happen when i did cider-eval irrc

thheller17:06:01

what did you eval though? REPL evals don't go through remove-dead-js-deps? so dunno why that would show up there?

thheller17:06:17

or did you eval something like (shadow/compile :app) in a CLJ REPL?

thheller17:06:27

meaning not a CLJS REPL?

Benjamin17:06:56

Not sure tbh. I used cider jack in clj + cljs

Benjamin17:06:17

I think it connects to the cljs repl by default

thheller17:06:10

well you should know what you eval'd no?

thheller17:06:38

if it was CLJS code or CLJ code I mean

thheller17:06:11

still no clue how you'd get that error in the REPL. if you run into it again let me know though.

Benjamin17:06:16

I can try to make a repro

thheller17:06:14

that would help

thheller17:06:30

which version do you use? if its something super old I can see this happening. with the latest not so much.

Benjamin17:06:26

should be "2.19.1"

Benjamin17:06:48

but you know what Stew said about debugging "everybody lies"

Benjamin17:06:44

(I mean maybe I'm wrong)

thheller17:06:30

well do you use only shadow-cljs.edn or do you use deps.edn/project.clj to manage dependencies?

thheller17:06:46

I mean shadow-cljs also tells you which version is running on startup

thheller17:06:14

dunno where emacs hides that though when using jack-in

Benjamin17:06:40

ye your're right

Benjamin17:06:13

I'll try to repro and send the repo

👍 1
vlad_poh08:06:39

does shadow-cljs have a lein-ancient equivalent? i.e checking dependency versions for newer versions

danielneal14:06:45

just starting a new shadow project and can’t seem to get off the ground

danielneal14:06:00

can anyone spot what is wrong with this picture?

danielneal14:06:06

it’s saying my namespace is not available

danielneal14:06:02

not trying to do anything complicated

danielneal15:06:28

ah it was a directory structure issue

vlad_poh16:06:41

New to clojurescript and shadow-cljs getting the following warnings when i run the following

npx shadow-cljs watch frontend
and not sure how to troubleshoot. App compiles and runs.
------ WARNING #1 - :undeclared-var --------------------------------------------
 Resource: cljs/analyzer.cljc:4403:12
--------------------------------------------------------------------------------
4400 |   []
4401 |   (try
4402 |     @(ns-resolve 'clojure.tools.reader '*alias-map*)
4403 |     (catch Throwable t
------------------^-------------------------------------------------------------
 Use of undeclared Var cljs.analyzer/Throwable
--------------------------------------------------------------------------------
4404 |       nil)))
4405 | 
4406 | #?(:clj
4407 |    (defn forms-seq*
--------------------------------------------------------------------------------

------ WARNING #2 - :undeclared-var --------------------------------------------
 Resource: cljs/analyzer.cljc:4402:7
--------------------------------------------------------------------------------
4399 |   "Returns clojure.tools.reader/*alias-map* for bridging"
4400 |   []
4401 |   (try
4402 |     @(ns-resolve 'clojure.tools.reader '*alias-map*)
-------------^------------------------------------------------------------------
 Use of undeclared Var cljs.analyzer/ns-resolve
--------------------------------------------------------------------------------
4403 |     (catch Throwable t
4404 |       nil)))
4405 | 
4406 | #?(:clj
--------------------------------------------------------------------------------

thheller16:06:04

@kbosompem this is a bug in the latest clojurescript release. it is fixed in master but no new release available yet. if you use deps.edn to manage dependencies you can use a git dependency to get it

thheller16:06:29

are you trying a self-hosted build? otherwise you shouldn't be including cljs.analyzer anyways?

vlad_poh16:06:13

@thheller thanks for the quick reply. I'm trying to follow the examples here https://github.com/metosin/reitit/blob/master/examples/frontend-re-frame/src/cljs/frontend_re_frame/core.cljs this is what my shadow-cljs.edn file looks like

;; shadow-cljs configuration
{:source-paths
 ["src/cljs"]

 :dependencies
 [[reagent "1.1.1"]
  [cljs-ajax "0.8.4"]
  [re-frame "0.10.6"]
  [metosin/reitit "0.5.11"]]

 :builds
 {:frontend {:target :browser
             :output-dir "resources/public/js"
             :asset-path "/js"
             :release {:compiler-options {:optimizations :simple}}
             :modules {:main {:init-fn spcmig.core/run}}}}}

thheller16:06:47

looks fine but I'm not sure if any of those may be including cljs.analyzer? seems like it shouldn't but I don't know

Vincent Cantin10:06:07

[reitit.coercion.spec :as rss] does require cljs.analyzer, that's why I reported the issue a few minutes ago 🙂

thheller10:06:30

well you probably wouldn't want to use that if you care about build size at all

thheller16:06:31

you can just downgrade shadow-cljs to 2.18.0. that'll have the older clojurescript version as well, so the warnings will be gone until the next release

👍 1