Fork me on GitHub
#shadow-cljs
<
2023-02-19
>
Kovas Palunas22:02:14

Anyone here ever get a bunch of these warnings when doing a cljs build?

------ WARNING #1 - :undeclared-var --------------------------------------------
 Resource: sci/impl/fns.cljc:141:28
 Use of undeclared Var sci.impl.fns/clojure
I found this reference to it: https://clojurians-log.clojureverse.org/shadow-cljs/2020-10-30, but I can't find anything like this in my current project: https://github.com/kovasap/cljs-board-game

borkdude22:02:28

Doesn't ring a bell. If I execute clojure -Stree in that project, I don't even see SCI as a dependency

borkdude22:02:50

How do you reproduce that message? With clj -M:frontend? This doesn't get past

[:app] Build failure:
The required namespace "hashp.core" is not available.
on my machine

Kovas Palunas23:02:59

i should add this to my project code

thheller05:02:04

this is a warning you usually get for referencing a clojure class in cljc files outside a conditional

thheller05:02:40

(extend-type clojure.lang.Whatever ...)

thheller05:02:30

assuming just an old version?

Kovas Palunas19:02:57

an old version of what?

Kovas Palunas19:02:07

(btw i added hashp to my project)

borkdude19:02:32

@U02KJ2MN5NU Can you present us with a very clear way to reproduce the problem? What do you run on the command line?

Kovas Palunas19:02:57

i run ./run.zsh when i'm working on the project

Kovas Palunas19:02:46

clj -M:frontend also reproduces tho

borkdude19:02:42

[:app] Build failure:
The required JS dependency "react-dom/client" is not available, it was required by "app/interface/core.cljs".

borkdude19:02:55

I already ran npm install

Kovas Palunas19:02:08

ah sorry, try yarn

borkdude19:02:48

but I already see the problem. An old version of SCI is pulled in via hashp -> zprint:

. zprint/zprint 1.1.1
    . rewrite-cljs/rewrite-cljs 0.4.5
      X org.clojure/tools.reader 1.3.2 :older-version
    X borkdude/edamame 0.0.11-alpha.28 :superseded
      X org.clojure/tools.reader 1.3.4 :older-version
    . borkdude/sci 0.2.1-alpha.1

borkdude19:02:24

zprint is now at 1.2.5

borkdude19:02:02

upgrading hashp to 0.2.2 will likely solve it

Kovas Palunas19:02:08

let me try updating hashp to 0.2.2

Kovas Palunas19:02:47

what tool did you use to discover this?

Kovas Palunas19:02:02

what printed your paste above?

borkdude19:02:06

clojure -A:frontend -Stree

Kovas Palunas19:02:16

ok thanks!

👍 2
Kovas Palunas19:02:42

oh no i think i may have tried this update before...

ultiple files failed to compile.
------ ERROR -------------------------------------------------------------------
 File: jar:file:/home/kovas/.m2/repository/zprint/zprint/1.2.4/zprint-1.2.4.jar!/zprint/comment.cljc:1:1
--------------------------------------------------------------------------------

   1 | (ns ^:no-doc zprint.comment
-------^------------------------------------------------------------------------
Invalid :refer, var rewrite-clj.zip/left* does not exist
--------------------------------------------------------------------------------
   2 |   #?@(:cljs [[:require-macros
   3 |               [zprint.macros :refer [dbg dbg-pr dbg-form dbg-print zfuture]]]])
   4 |   (:require #?@(:clj [[zprint.macros :refer
   5 |                        [dbg-pr dbg dbg-form dbg-print zfuture]]])
--------------------------------------------------------------------------------
------ ERROR -------------------------------------------------------------------
 File: jar:file:/home/kovas/.m2/repository/zprint/zprint/1.2.4/zprint-1.2.4.jar!/zprint/zutil.cljc:2:1
--------------------------------------------------------------------------------
   1 | ;!zprint {:style :require-justify}
   2 | (ns ^:no-doc zprint.zutil
-------^------------------------------------------------------------------------
Invalid :refer, var rewrite-clj.zip/right* does not exist
--------------------------------------------------------------------------------
   3 |   (:require
   4 |     #?@(:bb []
   5 |         :clj [[zprint.macros :refer [do-redef-vars]]])
   6 |     clojure.string
--------------------------------------------------------------------------------
I found an old post of mine at https://github.com/kkinnear/zprint/issues/246#issuecomment-1366386377 looks like i need to solve this problem to get rid of the warnings

Kovas Palunas20:02:49

thanks for all the help! the tree command is really useful

borkdude20:02:09

it's not recommended to put :deps in ~/.clojure/deps.edn - it's best to put those in an alias

Kovas Palunas20:02:54

hmm. the reason i have things like this is so that when i do small scripting projects with stuff like babashka i'll have this functionality

Kovas Palunas20:02:01

will aliases work for this?

Kovas Palunas20:02:34

i also might be misremembering why i set it up this way : P

borkdude20:02:08

alias work when you include them on the command line:

clj -M:my-alias:frontend

borkdude20:02:40

:deps in the home clojure file has really weird behavior, it always overrides your project dependencies instead of the other way around

borkdude20:02:50

so it's best to avoid it altogether and just use aliases

👍 2