Fork me on GitHub
#juxt
<
2022-11-21
>
Hukka08:11:22

I'm using tick (0.5.0; tick.core and tick.locale-en-us) with shadow-cljs and getting

------ WARNING #1 -  -----------------------------------------------------------
 File: ~/.m2/repository/tick/tick/0.5.0/tick-0.5.0.jar!/tick/locale_en_us.cljc:5:15
--------------------------------------------------------------------------------
   2 |   #?(:cljs (:require ["@js-joda/locale_en-us" :as js-joda-locale])))
   3 |
   4 | ; doing this for the one-arity tick.core/formatter. (npm users don't get js/JSJodaLocale global automatically)
   5 | #?(:cljs (set! js/JSJodaLocale js-joda-locale))
---------------------^----------------------------------------------------------
 constant JSJodaLocale assigned a value more than once.
Original definition at externs.shadow.js:4
Couldn't find anything with google, github issues, here or juxt zulip, and I don't have any idea what's wrong 😕 Any pointers?

henryw37411:11:27

it's only a warning. I guess there'll be a more shadow-friendly way to assign a var that it might already have as an extern

dvingo13:11:54

wouldn't a simple:

(when-not (exists? js/JSJodaLocale) (set! js/JSJodaLocale js-joda-locale))
address this?

henryw37413:11:07

no. it needs to set the value for it to work. the other def is just an extern afaict

dvingo13:11:44

ah i see what you're saying

dvingo13:11:15

maybe this then:

(goog.object/set js/global "JSJodaLocale" js-joda-locale)

henryw37413:11:37

yep worth a go 👍

🙂 1