Are you seeing an
"Insufficient com.taoensso/encore version"
exception while
trying to start your Clojure/Script project that uses one of my open source libraries?
Then you’re very likely experiencing an Encore dependency conflict.
Encore is a common support library used by my other open source. If you use more than one of my libraries, it’s unfortunately possible that you’ll encounter this issue from time to time.
These instructions assume that you’re using Leiningen, but similar principles apply to other dependency management tools.
Run lein deps :tree
to print a warning for
possible dependency conflicts, e.g.:
Possibly confusing dependencies found:
[com.taoensso/tempura "1.5.2"] -> [com.taoensso/encore "3.30.0"]
overrides
[com.taoensso/sente "1.19.1"] -> [com.taoensso/timbre "6.2.2"] -> [com.taoensso/encore "3.62.1"]
and
[com.taoensso/sente "1.19.1"] -> [com.taoensso/encore "3.62.1"]
A dependency conflict is normally caused by a situation like this in
your project.clj
:
:dependencies
"1.5.2"] ; Uses Encore 3.30.0 (OLD Encore)
[[com.taoensso/tempura "1.19.1"] ; Uses Encore 3.62.1 (NEW Encore)
[com.taoensso/sente ]
I.e. our project uses 2 libraries, and those libraries each use a different version of Encore. So Leiningen isn’t certain which version of Encore to use for our project.
By default it will use the Encore version of whichever library is listed first.
But we actually want it to always use the newer Encore version.
There’s two methods to achieve this:
Reorder your dependencies so that the library using the latest version of Encore appears first:
:dependencies
"1.19.1"] ; Uses Encore 3.62.1 (NEW Encore)
[[com.taoensso/sente "1.5.2"] ; Uses Encore 3.30.0 (OLD Encore)
[com.taoensso/tempura ]
Check your lein deps :tree
output to see which library
uses the newer version of Encore.
Include your own Encore dependency before any other
com.taoensso
libraries:
:dependencies
"3.62.1"] ; Above any other `com.taoensso` libraries
[[com.taoensso/encore "1.5.2"]
[com.taoensso/tempura "1.19.1"]
[com.taoensso/sente ]
Note that with this method you will be responsible for ensuring that you always use the latest version of Encore! So if you do choose this method, consider also using lein-ancient or another method of keeping track of updated dependencies.
After updating any dependencies, it’s always a good idea to run:
lein deps :tree
again to confirm that all conflicts
have been resolved.lein clean
to remove any stale/broken Clojure/Script
build artifacts.