This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-09
Channels
- # announcements (6)
- # babashka (17)
- # beginners (70)
- # calva (6)
- # chlorine-clover (88)
- # cider (9)
- # cljs-dev (9)
- # clojure (66)
- # clojure-australia (3)
- # clojure-czech (5)
- # clojure-europe (73)
- # clojure-nl (5)
- # clojure-spec (62)
- # clojure-uk (38)
- # clojurescript (30)
- # cursive (10)
- # datomic (16)
- # events (1)
- # figwheel-main (1)
- # fulcro (6)
- # graphql (21)
- # helix (4)
- # jackdaw (1)
- # jobs-rus (1)
- # kaocha (3)
- # luminus (11)
- # malli (28)
- # pedestal (3)
- # re-frame (2)
- # reagent (3)
- # sci (2)
- # shadow-cljs (21)
- # spacemacs (2)
- # sql (25)
- # timbre (2)
- # tools-deps (9)
- # tree-sitter (1)
- # xtdb (21)
I would appreciate help debugging a js interop issue I’m having. I’m clearly misunderstanding something pretty basic.
I am using the Vega library within my app. I’m compiling with Figwheel Main with NPM via :auto-bundle
. Everything works just fine in dev, but I get an error in my production build when calling Vega methods.
Vega is in my package.json
and I’m importing it into my ClojureScript source with: [vega :refer [parse View]]
. The code that causes the problem is:
(let [view (View. (parse (clj->js spec)) #js {:container (dom-node this)})]
(.runAsync view)))
Creating a View
object and calling the parse
function both work fine, but when I try to call the runAsync
method on the view, I get an error suggesting that advanced optimisations have chose to rename it.
Everything works just fine if I switch the last line to:
(js-invoke view "runAsync")))
Clearly I’m missing something I should be doing to tell the Closure compiler to leave the name of runAsync
alone, but I’ve no idea what that might be?