lynaghk / cljx

Write a portable codebase targeting Clojure/ClojureScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stacktrace while trying to lein cljs once

tillda opened this issue · comments

I got a stacktrace while trying to cljx the demo file from readme.MD. I wish I could provide more info but I don't know what else should I report. My project.clj is also pretty standard. The :cljx part looks like:

:cljx {:builds [{:source-paths ["src/cljx"]
             :output-path "target/cljx-generated/clj"
             :rules :clj}

            {:source-paths ["src/cljx"]
             :output-path "target/cljx-generated/cljs"
             :rules :cljs}]}

Here is what I get:

▸ lein cljx once
Rewriting src/cljx to target/cljx-generated/clj (clj) with features #{clj} and 0 transformations.
Exception in thread "main" java.lang.IndexOutOfBoundsException
at clojure.lang.RT.subvec(RT.java:1483)
at clojure.core$subvec.invoke(core.clj:3440)
at cljx.rules$apply_features.invoke(rules.clj:18)
at cljx.core$walk.invoke(core.clj:29)
at cljx.core$walk$fn__3486.invoke(core.clj:35)
at clojure.core$iterate$fn__4266.invoke(core.clj:2651)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:60)
at clojure.lang.Cons.next(Cons.java:39)
at clojure.lang.RT.next(RT.java:598)
at clojure.core$next.invoke(core.clj:64)
at clojure.core$some.invoke(core.clj:2443)
at cljx.core$walk.invoke(core.clj:32)
at cljx.core$walk$fn__3486.invoke(core.clj:35)
at clojure.core$iterate$fn__4266.invoke(core.clj:2651)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:60)
at clojure.lang.Cons.next(Cons.java:39)
at clojure.lang.RT.next(RT.java:598)
at clojure.core$next.invoke(core.clj:64)
at clojure.core$some.invoke(core.clj:2443)
at cljx.core$walk.invoke(core.clj:32)
at cljx.core$transform.invoke(core.clj:44)
at cljx.core$generate.invoke(core.clj:65)
at cljx.core$cljx_compile.invoke(core.clj:86)
at clojure.lang.Var.invoke(Var.java:415)
at user$eval3531.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:6619)
at clojure.lang.Compiler.eval(Compiler.java:6608)
at clojure.lang.Compiler.eval(Compiler.java:6609)
at clojure.lang.Compiler.eval(Compiler.java:6582)
at clojure.core$eval.invoke(core.clj:2852)
at clojure.main$eval_opt.invoke(main.clj:308)
at clojure.main$initialize.invoke(main.clj:327)
at clojure.main$null_opt.invoke(main.clj:362)
at clojure.main$main.doInvoke(main.clj:440)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:419)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.main.main(main.java:37)
Subprocess failed

I'm afraid I can't reproduce. I put together a dummy project using the sample in the README; the results are here. lein cljx once works as expected, with .clj and .cljs files in target/classes.

The exception looks like it's being produced by core.match-generated code. Any chance your project depends upon core.match, perhaps an older version?

Thanks a lot! I upgraded core.match to 0.2.0-rc3 and it works.