Bringing up a new stack for a fresh project. I’m seeing a pile of warnings around Google logging.
[Figwheel:WARNING] Compile Warning target/public/cljs-out/dev/figwheel/repl.cljc line:52 column:17
Wrong number of args (1) passed to goog.log/getLogger
47 ;; goog.debug.Logger.Level.(SEVERE WARNING INFO CONFIG FINE FINER FINEST)
48 ;;
49 ;; set level (.setLevel logger <http://goog.debug.Logger.Level.INFO|goog.debug.Logger.Level.INFO>)
50 ;; disable (.setCapturing log-console false)
51
52 (defonce logger (glog/getLogger "Figwheel REPL"))
^---
53
54 (defn ^:export console-logging []
55 (when-not (gobj/get goog.debug.Console "instance")
56 (let [c (goog.debug.Console.)]
57 ;; don't display time
[Figwheel:WARNING] Compile Warning target/public/cljs-out/dev/figwheel/repl.cljc line:70 column:3
Wrong number of args (3) passed to goog.log/log
65 true))
66
67 (defonce log-console (console-logging))
68
69 (defn debug [msg]
70 (glog/log logger goog.debug.Logger.Level.FINEST msg))
^---
71
72 ;; TODO dev
73 #_(.setLevel logger goog.debug.Logger.Level.FINEST)
74
75 ;; --------------------------------------------------------------
[Figwheel:WARNING] Compile Warning target/public/cljs-out/dev/figwheel/repl.cljc line:153 column:17
Wrong number of args (2) passed to goog.log/error
148 {:pre [(string? request-url) (not (nil? callback))]}
149 (callback (try
150 (do (.importScripts js/self (add-cache-buster request-url))
151 true)
152 (catch js/Error e
153 (glog/error logger (str "Figwheel: Error loading file " request-url))
^---
154 (glog/error logger e)
155 false))))
156
157 (defn ^:export create-node-script-import-fn []
158 (let [node-path-lib (js/require "path")
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/error target/public/cljs-out/dev/figwheel/repl.cljc line:154 column:17
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/error target/public/cljs-out/dev/figwheel/repl.cljc line:173 column:23
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/error target/public/cljs-out/dev/figwheel/repl.cljc line:174 column:23
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/fine target/public/cljs-out/dev/figwheel/repl.cljc line:200 column:3
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/fine target/public/cljs-out/dev/figwheel/repl.cljc line:206 column:10
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/error target/public/cljs-out/dev/figwheel/repl.cljc line:209 column:10
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/error target/public/cljs-out/dev/figwheel/repl.cljc line:230 column:43
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/info target/public/cljs-out/dev/figwheel/repl.cljc line:343 column:3
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/info target/public/cljs-out/dev/figwheel/repl.cljc line:344 column:3
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/error target/public/cljs-out/dev/figwheel/repl.cljc line:470 column:9
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/error target/public/cljs-out/dev/figwheel/repl.cljc line:491 column:38
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/error target/public/cljs-out/dev/figwheel/repl.cljc line:563 column:22
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/info target/public/cljs-out/dev/figwheel/repl.cljc line:569 column:16
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/error target/public/cljs-out/dev/figwheel/repl.cljc line:580 column:16
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/info target/public/cljs-out/dev/figwheel/repl.cljc line:584 column:16
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/warning target/public/cljs-out/dev/figwheel/repl.cljc line:596 column:7
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/warning target/public/cljs-out/dev/figwheel/repl.cljc line:620 column:5
[Figwheel:WARNING] Compile Warning: Wrong number of args (1) passed to goog.log/getLogger target/public/cljs-out/dev/figwheel/core.cljc line:111 column:17
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/info target/public/cljs-out/dev/figwheel/core.cljc line:262 column:11
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/warning target/public/cljs-out/dev/figwheel/core.cljc line:264 column:9
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/info target/public/cljs-out/dev/figwheel/core.cljc line:262 column:11
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/warning target/public/cljs-out/dev/figwheel/core.cljc line:264 column:9
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/info target/public/cljs-out/dev/figwheel/core.cljc line:291 column:19
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/info target/public/cljs-out/dev/figwheel/core.cljc line:295 column:19
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/warning target/public/cljs-out/dev/figwheel/core.cljc line:313 column:5
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/warning target/public/cljs-out/dev/figwheel/core.cljc line:313 column:5
[Figwheel:WARNING] Compile Warning: Wrong number of args (2) passed to goog.log/warning target/public/cljs-out/dev/figwheel/core.cljc line:328 column:5
The REPL fails with:
Uncaught TypeError: logger_SINGLEQUOTE_.setLevel is not a function
at figwheel$repl$set_log_level (repl.cljc:618)
at figwheel$repl$init_log_level_BANG_ (repl.cljc:628)
at figwheel$repl$connect_STAR_ (repl.cljc:631)
at repl.cljc:640
at Function.cljs$core$IFn$_invoke$arity$variadic (repl.cljc:640)
at figwheel$repl$connect (repl.cljc:638)
at preload.cljs:5
Project is:
(defproject svgjs-figwheel-main "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.10.1"]]
:profiles {:dev {:dependencies [[org.clojure/clojurescript "1.10.844"]
[com.bhauman/figwheel-main "0.2.11"]
;; optional but recommended
[com.bhauman/rebel-readline-cljs "0.1.4"]
[com.stuartsierra/component "1.0.0"]
[net.cassiel/lifecycle "0.1.0-SNAPSHOT"]]
:resource-paths ["target"]
:clean-targets ^{:protect false} ["target"]}}
:aliases {"fig" ["trampoline" "run" "-m" "figwheel.main"]})
Things worked fine (still with the warnings, but the REPL worked) with slightly older package versions. I’ll roll it back and double-check.
@cassiel that’s a breaking change in closure, see https://github.com/clojure/clojurescript-site/blob/0d35426cbb18521ece37f6e7c16b108a9883935c/content/news/2021-04-xx-release.adoc#noteworthy--breaking-changes
Ah - cheers. Looks like it needs attention within Figwheel then. I will try to have a look at that, but in the meantime will roll back my CLJS version.
All clear with 1.10.773
, which is after all the one recommended at http://clojurescript.org. But I followed that link through, saw 1.10.844
, and stupidly jumped on it. My bad.
FYI, in case folks want to chime in https://ask.clojure.org/index.php/10403/pros-and-cons-figwheel-vs-shadowcljs