Just found that adding this middleware to a project using figwheel results in an illegal argument arity exception. Seems to be related to org.clojure/tools.reader. If I add
[org.clojure/tools.reader "0.9.2"]
to my project.clj dependencies, all is good.
Can easily reproduce the issue by doing
lein new reagent test-project
then add ring-middleware-format to the dependencies in the project.clj file and try
lein figwheel
The exception I get is
'''
clojure.lang.ArityException: Wrong number of args (2) passed to: reader/read
at clojure.lang.AFn.throwArity(AFn.java:429)
at clojure.lang.AFn.invoke(AFn.java:36)
at cljs.analyzer$forms_seqSTAR$forms_seq_2094$fn2095$fn2096.invoke(analyzer.cljc:2039)
at cljs.analyzer$forms_seqSTAR$formsseq2094$fn2095.invoke(analyzer.cljc:2033)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.RT.seq(RT.java:507)
at clojure.core$seq4126.invoke(core.clj:135)
at cljs.analyzer$parse_ns$fn2110.invoke(analyzer.cljc:2110)
at cljs.analyzer$parse_ns.invoke(analyzer.cljc:2093)
at cljs.analyzer$parse_ns.invoke(analyzer.cljc:2084)
at cljs.analyzer$analyze_file.invoke(analyzer.cljc:2211)
at cljs.compiler$with_core_cljs.invoke(compiler.cljc:967)
at figwheel_sidecar.repl$analyze_core_cljs$fn22017.invoke(repl.clj:263)
at figwheel_sidecar.repl$analyze_core_cljs.invoke(repl.clj:261)
at figwheel_sidecar.repl$run_autobuilder_helper.invoke(repl.clj:298)
at figwheel_sidecar.repl$start_autobuild.invoke(repl.clj:376)
at figwheel_sidecar.repl$run_autobuilder.invoke(repl.clj:535)
at user$eval22121.invoke(form-init6224360995827217453.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6792)
at clojure.lang.Compiler.eval(Compiler.java:6782)
at clojure.lang.Compiler.load(Compiler.java:7237)
at clojure.lang.Compiler.loadFile(Compiler.java:7175)
at clojure.main$load_script.invoke(main.clj:275)
at clojure.main$init_opt.invoke(main.clj:280)
at clojure.main$initialize.invoke(main.clj:308)
at clojure.main$null_opt.invoke(main.clj:343)
at clojure.main$main.doInvoke(main.clj:421)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:383)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)
Subprocess failed
'''
Just found that adding this middleware to a project using figwheel results in an illegal argument arity exception. Seems to be related to org.clojure/tools.reader. If I add
to my project.clj dependencies, all is good.
Can easily reproduce the issue by doing
then add ring-middleware-format to the dependencies in the project.clj file and try
The exception I get is
''' clojure.lang.ArityException: Wrong number of args (2) passed to: reader/read at clojure.lang.AFn.throwArity(AFn.java:429) at clojure.lang.AFn.invoke(AFn.java:36) at cljs.analyzer$forms_seqSTAR$forms_seq_2094$fn2095$fn2096.invoke(analyzer.cljc:2039) at cljs.analyzer$forms_seqSTAR$formsseq2094$fn2095.invoke(analyzer.cljc:2033) at clojure.lang.LazySeq.sval(LazySeq.java:40) at clojure.lang.LazySeq.seq(LazySeq.java:49) at clojure.lang.RT.seq(RT.java:507) at clojure.core$seq4126.invoke(core.clj:135) at cljs.analyzer$parse_ns$fn2110.invoke(analyzer.cljc:2110) at cljs.analyzer$parse_ns.invoke(analyzer.cljc:2093) at cljs.analyzer$parse_ns.invoke(analyzer.cljc:2084) at cljs.analyzer$analyze_file.invoke(analyzer.cljc:2211) at cljs.compiler$with_core_cljs.invoke(compiler.cljc:967) at figwheel_sidecar.repl$analyze_core_cljs$fn22017.invoke(repl.clj:263) at figwheel_sidecar.repl$analyze_core_cljs.invoke(repl.clj:261) at figwheel_sidecar.repl$run_autobuilder_helper.invoke(repl.clj:298) at figwheel_sidecar.repl$start_autobuild.invoke(repl.clj:376) at figwheel_sidecar.repl$run_autobuilder.invoke(repl.clj:535) at user$eval22121.invoke(form-init6224360995827217453.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6792) at clojure.lang.Compiler.eval(Compiler.java:6782) at clojure.lang.Compiler.load(Compiler.java:7237) at clojure.lang.Compiler.loadFile(Compiler.java:7175) at clojure.main$load_script.invoke(main.clj:275) at clojure.main$init_opt.invoke(main.clj:280) at clojure.main$initialize.invoke(main.clj:308) at clojure.main$null_opt.invoke(main.clj:343) at clojure.main$main.doInvoke(main.clj:421) at clojure.lang.RestFn.invoke(RestFn.java:421) at clojure.lang.Var.invoke(Var.java:383) at clojure.lang.AFn.applyToHelper(AFn.java:156) at clojure.lang.Var.applyTo(Var.java:700) at clojure.main.main(main.java:37) Subprocess failed '''