kit
kit copied to clipboard
Not able to append-requires in cljs file when installing a module
I created a pull request https://github.com/kit-clj/modules/pull/7 to add Sente support as a module for kit.
Steps to reproduce:
- Create a kit project with default parameters.
- update kit.edn to fetch modules from https://github.com/markokocic/modules sente branch
- Try to install
:kit/sente
module
When calling (kit/install-module :kit/sente)
, I get the following error:
user=> (kit/install-module :kit/sente)
java.lang.ClassCastException: class java.lang.String cannot be cast to class clojure.lang.IFn (java.lang.String is in module java.base of loader 'bootstrap'; clojure.lang.IFn is in unnamed module of loader 'app')
at clojure.zip$end_QMARK_.invokeStatic(zip.clj:262)
at clojure.zip$end_QMARK_.invoke(zip.clj:258)
at rewrite_clj.custom_zipper.core$end_QMARK_.invokeStatic(core.cljc:263)
at rewrite_clj.custom_zipper.core$end_QMARK_.invoke(core.cljc:263)
at rewrite_clj.zip.move$end_QMARK_.invokeStatic(move.cljc:42)
at rewrite_clj.zip.move$end_QMARK_.invoke(move.cljc:38)
at clojure.core$complement$fn__5737.invoke(core.clj:1455)
at clojure.core$take_while$fn__5986.invoke(core.clj:2923)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.RT.seq(RT.java:535)
at clojure.core$seq__5467.invokeStatic(core.clj:139)
at clojure.core$drop_while$step__6009.invoke(core.clj:2989)
at clojure.core$drop_while$fn__6012.invoke(core.clj:2994)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.LazySeq.first(LazySeq.java:73)
at clojure.lang.RT.first(RT.java:692)
at clojure.core$first__5449.invokeStatic(core.clj:55)
at clojure.core$first__5449.invoke(core.clj:55)
at rewrite_clj.zip.findz$find.invokeStatic(findz.cljc:44)
at rewrite_clj.zip.findz$find.invoke(findz.cljc:31)
at rewrite_clj.zip.findz$find_token.invokeStatic(findz.cljc:119)
at rewrite_clj.zip.findz$find_token.invoke(findz.cljc:110)
at rewrite_clj.zip.findz$find_value.invokeStatic(findz.cljc:146)
at rewrite_clj.zip.findz$find_value.invoke(findz.cljc:131)
at rewrite_clj.zip$find_value.invokeStatic(zip.cljc:425)
at rewrite_clj.zip$find_value.invoke(zip.cljc:415)
at kit.generator.modules.injections$append_requires.invokeStatic(injections.clj:236)
at kit.generator.modules.injections$append_requires.invoke(injections.clj:235)
at kit.generator.modules.injections$eval10332$fn__10334.invoke(injections.clj:289)
at clojure.lang.MultiFn.invoke(MultiFn.java:229)
at kit.generator.modules.injections$inject_at_path$fn__10409.invoke(injections.clj:358)
at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
at clojure.core$reduce.invokeStatic(core.clj:6885)
at clojure.core$reduce.invoke(core.clj:6868)
at kit.generator.modules.injections$inject_at_path.invokeStatic(injections.clj:356)
at kit.generator.modules.injections$inject_at_path.invoke(injections.clj:353)
at kit.generator.modules.injections$inject_data.invokeStatic(injections.clj:375)
at kit.generator.modules.injections$inject_data.invoke(injections.clj:368)
at kit.generator.modules.generator$eval10523$fn__10525.invoke(generator.clj:66)
at clojure.lang.MultiFn.invoke(MultiFn.java:234)
at kit.generator.modules.generator$generate.invokeStatic(generator.clj:138)
at kit.generator.modules.generator$generate.invoke(generator.clj:110)
at kit.api$install_module.invokeStatic(api.clj:37)
at kit.api$install_module.invoke(api.clj:27)
at kit.api$install_module.invokeStatic(api.clj:29)
at kit.api$install_module.invoke(api.clj:27)
at user$eval30485.invokeStatic(NO_SOURCE_FILE:1)
at user$eval30485.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:7194)
at clojure.lang.Compiler.eval(Compiler.java:7149)
at clojure.core$eval.invokeStatic(core.clj:3215)
at clojure.core$eval.invoke(core.clj:3211)
at nrepl.middleware.interruptible_eval$evaluate$fn__26216$fn__26217.invoke(interruptible_eval.clj:87)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$with_bindings_STAR_.invokeStatic(core.clj:1990)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1990)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at nrepl.middleware.interruptible_eval$evaluate$fn__26216.invoke(interruptible_eval.clj:87)
at clojure.main$repl$read_eval_print__9206$fn__9209.invoke(main.clj:437)
at clojure.main$repl$read_eval_print__9206.invoke(main.clj:437)
at clojure.main$repl$fn__9215.invoke(main.clj:458)
at clojure.main$repl.invokeStatic(main.clj:458)
at clojure.main$repl.doInvoke(main.clj:368)
at clojure.lang.RestFn.invoke(RestFn.java:1523)
at nrepl.middleware.interruptible_eval$evaluate.invokeStatic(interruptible_eval.clj:84)
at nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:56)
at nrepl.middleware.interruptible_eval$interruptible_eval$fn__26249$fn__26253.invoke(interruptible_eval.clj:152)
at clojure.lang.AFn.run(AFn.java:22)
at nrepl.middleware.session$session_exec$main_loop__26319$fn__26323.invoke(session.clj:218)
at nrepl.middleware.session$session_exec$main_loop__26319.invoke(session.clj:217)
at clojure.lang.AFn.run(AFn.java:22)
at java.base/java.lang.Thread.run(Thread.java:829)
:kit/sente requires following modules: [:kit/cljs]
:kit/cljs requires following modules: [:kit/html]
:kit/html requires following modules: nil
module :kit/html is already installed!
module :kit/cljs is already installed!
updating file: deps.edn
updating file: shadow-cljs.edn
updating file: resources/system.edn
updating file: src/clj/marko/sentem/core.clj
applying
action: :append-requires
value: ["[marko.sentem.web.routes.ws]"]
updating file: src/cljs/marko/sentem/core.cljs
applying
action: :append-requires
value: ["[marko.sentem.ws :as ws]"]
failed to install module :kit/sente
:done
user=>
Looks like it's tracing to kit.generator.modules.injections$append_requires
, although the syntax in the module looks right to me. You might've uncovered a bug in the injections here.