Fork me on GitHub
#juxt
<
2022-01-26
>
noprompt18:01:01

Has anyone tried building an :esm library that used tick? I’m stuck trying to figure out why

Uncaught ReferenceError: assignment to undeclared variable JSJodaLocale
happens. I saw this when I compiling
------ WARNING #1 -  -----------------------------------------------------------
 File: ~/.m2/repository/tick/tick/0.4.32/tick-0.4.32.jar!/tick/locale_en_us.cljc:5:31
--------------------------------------------------------------------------------
   2 |   #?(:cljs (:require ["@js-joda/locale_en-us" :as js-joda-locale])))
   3 |
   4 | ; doing this for the one-arity tick.format/formatter. (npm users don't get js/JSJodaLocale global automatically)
   5 | #?(:cljs (set! js/JSJodaLocale js-joda-locale))
-------------------------------------^------------------- 
so I thought importing that @js-joda/locale_en-us manually would solve the problem but that just moved the goal post to
Uncaught TypeError: root is undefined

henryw37409:01:34

can you avoid including the locale ns?

noprompt17:01:41

I’ll give this a shot.

noprompt18:02:06

Following up on this: we gave up on trying to build an ESM module. This isn’t tick’s fault though. 🙂

henryw37409:02:08

ok, bummer! I've not tried making any esm modules myself

noprompt18:01:33

When I compile a :browser version of library it works fine.

noprompt18:01:10

But the moment I try to export anything from it I end up in this situation.

noprompt18:01:39

I’m willing to bet that the issue is trivial and I’m likely overlooking something or missing some information.