Fork me on GitHub
#shadow-cljs
<
2022-02-12
>
Lucy Wang10:02:07

The latest 2.17.1 throws me an error when I have a namespace aliased as foo and also refers to a foo symbol

(ns myapp.my-ns
  (:require [myapp.ns1 :as foo]
            [myapp.ns2 :refer [foo]]))

;; how i use them:
foo/var1 ;; resolves to myapp.ns1/var1
foo ;; resolves to myapp.ns2/foo
"Error: The alias foo is already used for namespace myapp.ns1" Reverting to 2.16.12 has no such issue.

thheller15:02:31

oops, fixed in 2.17.2

Lucy Wang01:02:30

Thanks Thomas!

pez11:02:56

I need help figuring out how to configure dependencies when having three direct dependencies that all want different version of a transitive dependency. Specifically they all depend on different version of rewrite-clj. I naively thought this would just work, but it seems the three dependencies get to share the same version of rewrite-clj.

pez13:02:37

I can almost get it to work by reordering the dependencies. But one of them is extra tricky. It doesn't even need rewrite-clj, because I am only really using rewrite-cljs ... Trying this, but it doesn't work:

[pez/cljfmt "0.0.5-SNAPSHOT" :exclusions [rewrite-clj]]

pez15:02:10

Wait, I'm thinking about it in the wrong way, right? It is not so much the library name that clashes, it's the top namespace. Hmmm. Is a solution to let Leiningen handle deps and use mranderson?

thheller15:02:41

easiest way is to just configure the rewrite-clj version you need in your dependencies

thheller15:02:04

that'll always win, no need to mess with exclusions and such then

pez15:02:38

The dependencies need different rewrite-clj implementations...

pez16:02:13

I solved it by copying rewrite-cljs into my project and renaming the top-level ns. 😃

Aron19:02:03

Doesn't sound like a solution I would like to resort to.

pez19:02:09

It’s a special situation. rewrite-cljs is a frozen/archived library.

Aron19:02:34

But how can it happen that the versions are so incompatible that different dependencies conflict because of it? I don't understand.

pez19:02:13

It’s a long story.

❤️ 1