bhauman / figwheel-repl

Figwheel REPL provides a stable multiplexing REPL for ClojureScript
45 stars 11 forks source link

Fix spec error #17

Closed borkdude closed 2 years ago

borkdude commented 3 years ago

Hi @bhauman. We're using figwheel during development and also clojure.spec. When upgrading to the latest figwheel, our compilation process failed due to a spec error.

Caused by: clojure.lang.ExceptionInfo: Call to cljs.core/ns-special-form did not conform to spec. #:clojure.spec.alpha{:problems ({:path [:ns-clauses :refer-clojure :clause], :pred #{:refer-clojure}, :val :import, :via [:cljs.core.specs.alpha/ns-form :cljs.core.specs.alpha/ns-refer-clojure :cljs.core.specs.alpha/ns-refer-clojure], :in [2 0]} {:path [:ns-clauses :require :clause], :pred #{:require}, :val :import, :via [:cljs.core.specs.alpha/ns-form :cljs.core.specs.alpha/ns-require :cljs.core.specs.alpha/ns-require], :in [2 0]} {:path [:ns-clauses :require-macros :clause], :pred #{:require-macros}, :val :import, :via [:cljs.core.specs.alpha/ns-form :cljs.core.specs.alpha/ns-require-macros :cljs.core.specs.alpha/ns-require-macros], :in [2 0]} {:path [:ns-clauses :import :classes :class], :pred clojure.core/simple-symbol?, :val [goog.debug.Console], :via [:cljs.core.specs.alpha/ns-form :cljs.core.specs.alpha/ns-import :cljs.core.specs.alpha/ns-import :cljs.core.specs.alpha/import-list], :in [2 1]} {:path [:ns-clauses :import :classes :package-list :classes], :reason "Insufficient input", :pred clojure.core/simple-symbol?, :val (), :via [:cljs.core.specs.alpha/ns-form :cljs.core.specs.alpha/ns-import :cljs.core.specs.alpha/ns-import :cljs.core.specs.alpha/import-list :cljs.core.specs.alpha/package-list :cljs.core.specs.alpha/package-list], :in [2 1]} {:path [:ns-clauses :use :clause], :pred #{:use}, :val :import, :via [:cljs.core.specs.alpha/ns-form :cljs.core.specs.alpha/ns-use :cljs.core.specs.alpha/ns-use], :in [2 0]} {:path [:ns-clauses :use-macros :clause], :pred #{:use-macros}, :val :import, :via [:cljs.core.specs.alpha/ns-form :cljs.core.specs.alpha/ns-use-macros :cljs.core.specs.alpha/ns-use-macros], :in [2 0]}), :spec #object[clojure.spec.alpha$regex_spec_impl$reify__2509 0x5f4e4344 "clojure.spec.alpha$regex_spec_impl$reify__2509@5f4e4344"], :value (figwheel.repl.logging (:require [goog.log :as glog] [goog.object :as gobj] [clojure.string :as string]) (:import [goog.debug.Console] [goog.debug.Logger])), :args (figwheel.repl.logging (:require [goog.log :as glog] [goog.object :as gobj] [clojure.string :as string]) (:import [goog.debug.Console] [goog.debug.Logger]))}

It seems the core specs don't like the imports from the figwheel.repl.logging ns which this PR fixes.

Clj-kondo also warned about it:

Screenshot 2021-08-13 at 21 01 54

and after fixing it, clj-kondo showed that you're not actually using these imports, but I left them in to not change the code too much.

thiru commented 2 years ago

Please take the following pull request instead which fixes this issue and a breaking change in Google Closure: https://github.com/bhauman/figwheel-repl/pull/18

bhauman commented 2 years ago

Finally addressed this sorry it took so long. I thought I had done it already. The change is in 0.2.16-SNAPSHOT