magomimmo / modern-cljs

A series of tutorials on ClojureScript
2.92k stars 288 forks source link

Tutorial 2: Dependencies issue #455

Open zackteo opened 4 years ago

zackteo commented 4 years ago

When running

boot wait serve -d target cljs target

I seem to either get error on the serving step (if I use the dependencies in the md document)

java.io.FileNotFoundException: Could not locate nrepl/server__init.class or nrepl/server.clj on classpath.
clojure.lang.Compiler$CompilerException: java.io.FileNotFoundException: Could not locate nrepl/server__init.class or nrepl/server.clj on classpath., compiling:(boot/repl_server.clj:1:1)
clojure.lang.ExceptionInfo: java.io.FileNotFoundException: Could not locate nrepl/server__init.class or nrepl/server.clj on classpath., compiling:(boot/repl_server.clj:1:1)

or the compiling step (if I use the latest dependencies)

java.lang.RuntimeException: No such var: str/includes?
clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: No such var: str/includes?, compiling:(adzerk/boot_cljs/impl.clj:88:44)
clojure.lang.ExceptionInfo: java.lang.RuntimeException: No such var: str/includes?, compiling:(adzerk/boot_cljs/impl.clj:88:44)

This seems to work out

(set-env!
 :source-paths #{"src/cljs"}
 :resource-paths #{"html"}

 :dependencies '[[adzerk/boot-cljs "1.7.228-2"]
                 [pandeiro/boot-http "0.8.3"]])         ;; add http dependency
                 ;[org.clojure/tools.nrepl "0.2.12"]]) ;; required by boot-http

(require '[adzerk.boot-cljs :refer [cljs]]
         '[pandeiro.boot-http :refer [serve]]) ;; make serve task visible
zackteo commented 4 years ago

Subsequently for

boot serve -d target watch reload cljs-repl cljs target

I took reference to the dependencies in https://github.com/adzerk-oss/boot-cljs-repl

xmpace commented 3 years ago

I met the same problem, and your solution works, thank you!