taoensso / timbre

Pure Clojure/Script logging library
https://www.taoensso.com/timbre
Eclipse Public License 1.0
1.44k stars 171 forks source link

Elision env vars during cljs compilation creates invalid JS #335

Closed jamesnvc closed 3 years ago

jamesnvc commented 3 years ago

It seems that if I have an elision environment variable set (e.g. TAOENSSO_TIMBRE_NS_PATTERN_END="{#{:allow #{"*"} :deny #{"some.other.core"}}) and have clojurescript compilation running as part of the uberjar (e.g. in project.clj

(defproject ...
;;; etc
 :profiles 
  {:uberjar
       {:prep-tasks
        ["compile"
          ["trampoline" "run" "-m" "figwheel.main" "-bo" "prod"]]}})

then when uberjarring, that the println from timbre.cljc ends up in the generated javascript -- the second line of timbre.js is Compile-time (elision) Timbre ns-pattern: ..., which causes a parse error and aborts the compilation.

ptaoussanis commented 3 years ago

@jamesnvc Hi James,

Thanks for the report! Any chance you could provide a minimal reproducible? Does this seem only with figwheel?

jamesnvc commented 3 years ago

Ah, it seems that the culprit is running figwheel with trampoline; if I remove the "trampoline" from :prep-tasks (which I ended up needing to do to fix other issues), then it works fine.