binaryage / cljs-oops

ClojureScript macros for convenient native Javascript object access.
Other
351 stars 13 forks source link

Cannot find clojure.spec #7

Closed arichiardi closed 7 years ago

arichiardi commented 7 years ago

Hello Darwin, I have a project on clojure 1.8.0 and I receive the following.

clojure.lang.ExceptionInfo: failed compiling file:/home/arichiardi/git/rest-resources-viz/src/web/rest_resource_viz/core.cljs {:file #object[java.io.File 0xadc8c4b "/home/arichiardi/git/rest-resources-viz/src/web/rest_resource_viz/core.cljs"]}
...
Caused by: java.io.FileNotFoundException: Could not locate clojure/spec__init.class or clojure/spec.clj on classpath., compiling:(oops/config.clj:1:1)
...
Caused by: java.io.FileNotFoundException: Could not locate clojure/spec__init.class or clojure/spec.clj on classpath.
        ...
        at clojure.core$require.doInvoke(core.clj:5796)
        at clojure.lang.RestFn.invoke(RestFn.java:512)
->      at oops.config$eval30123$loading__5569__auto____30124.invoke(config.clj:1)**
->      at oops.config$eval30123.invokeStatic(config.clj:1)**
->      at oops.config$eval30123.invoke(config.clj:1)**
        at clojure.lang.Compiler.eval(Compiler.java:6927)
        at clojure.lang.Compiler.eval(Compiler.java:6916)
        at clojure.lang.Compiler.load(Compiler.java:7379)
        ... 117 more

Is there a way to avoid requiring clojure.spec if not present at the moment?

Thanks for this lib, it looks fun!

darwin commented 7 years ago

Spec is a hard requirement. I use it not only for validation but also for destructuring inputs.

Look here: https://github.com/binaryage/cljs-oops#integrate-with-your-project

If you cannot upgrade to Clojure 1.9, you may stick with Clojure 1.8 and add this backported version of clojure.spec => https://github.com/tonsky/clojure-future-spec