This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-24
Channels
- # announcements (2)
- # beginners (22)
- # cider (10)
- # clojure (47)
- # clojure-italy (2)
- # clojure-spec (2)
- # clojure-uk (1)
- # clojurebridge (5)
- # clojurescript (19)
- # cursive (1)
- # data-science (7)
- # datomic (2)
- # duct (18)
- # emacs (6)
- # figwheel-main (2)
- # java (2)
- # luminus (1)
- # nrepl (20)
- # off-topic (69)
- # om (3)
- # pathom (45)
- # quil (2)
- # re-frame (16)
- # reagent (1)
- # reitit (6)
- # ring (2)
- # shadow-cljs (33)
- # tools-deps (9)
- # vim (6)
- # yada (1)
I'm having an issue with closure using JavaScript from a worker. I extend a class from an external library, this works for the non :web-worker true
. But when importing the class into a worker I get
Uncaught ReferenceError: $jscomp is not defined
Which seems to be part of the closure runtime. Importing the class that I extend into the worker does work. I'm not sure how to fix it, maybe I can include something manually/pass flags to closure to make this work. Any ideas?it should be created in the default base module which should be imported by the worker module
:target :browser
...
:modules {:shared {:entries []}
:worker-shared {:entries []
:depends-on #{:shared}}
:app {:entries [app.client]
:depends-on #{:web-shared}}
:filter-worker {:entries [app.filter-worker]
:depends-on #{:worker-shared}
:web-worker true}}
I have a .js file that imports a class from the a node_modules lib and extends it. This works when importing that JS file in :app
module, but it doesn't work when importing in the :filter-worker
.can you check the shared.js
? it should contain /** @const */ var $jscomp = $jscomp || {};
right at the top?
and filter-worker.js should contain the importScripts("shared.js")
right at the top? + worker-shared.js
?
https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/build/targets/browser.clj#L480
@chris.schreiner 1.10 should be used by default in recent releases?
came across what appears to be an odd compiler renaming bug, https://github.com/thheller/shadow-cljs/issues/447