I’ve just started a clojurescript app (full background Starting a new ClojureScript project in 2022. Setup suggestions) which is meant to use a local library that I’m working on in parallel.
This library was originally created in Leiningen, but my new app uses CLI tools.
The library was written in Clojure but all the files have been adapted to cljc files. The library is already on Clojars, but I now want to work on a new version in parallel with the project that uses it.
So I’ve added to the old library directory the following deps.edn file :
{:deps
{org.clojure/clojure {:mvn/version "1.10.0"}
org.clojure/clojurescript {:mvn/version "1.7.28"}
orchestra/orchestra {:mvn/version "2021.01.01-1"}
}}
Those are the library’s own dependencies as defined in the project.clj file.
In my new app’s deps.edn I started with
com.myname/mylib {:mvn/version "VERSION"}
where VERSION was the latest Clojars version number of the library. And this works fine. The library from Clojars downloads and works as part of my new app.
However, I then change it to :
com.myname/mylib
{:local/root "/media/phil/path/to/mylib"
:deps/manifest :deps}
Where /media/phil/path/to/mylib is correct.
And when I tried to run my new app now, I see that it’s found the library project and read the deps.edn file, because it downloaded the new version of orchestra (I bumped up the version number)
However it then throws an error:
Downloading: orchestra/orchestra/2021.01.01-1/orchestra-2021.01.01-1.pom from clojars
Downloading: orchestra/orchestra/2021.01.01-1/orchestra-2021.01.01-1.jar from clojars
[Figwheel] Validating figwheel-main.edn
[Figwheel] figwheel-main.edn is valid \(ツ)/
[Figwheel] Compiling build dev to "target/public/cljs-out/dev-main.js"
[Figwheel] Failed to compile build dev in 3.635 seconds.
[Figwheel:WARNING] Compile Exception: No such namespace: mylib.foo, could not locate mylib/foo.cljs, mylib/foo.cljc, or JavaScript source providing "mylib.foo" in file /media/phil/path/to/new/project/src/newapp/bar.cljs target/public/cljs-out/dev/generated-input-files/gen_test_runner.cljs
[Figwheel:SEVERE] failed compiling file:target/public/cljs-out/dev/generated-input-files/gen_test_runner.cljs
[Figwheel] Starting Server at http://localhost:9500
So what’s going on?
The app goes on to run, but only because it seems to have a copy of the code derived from the Clojars version of the library hanging around somewhere. It’s not able to compile or use the new code in the local copy of the library.
Have I just missed something else I need? Or is this some other kind of bug?