This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-15
Channels
- # announcements (71)
- # architecture (2)
- # aws (41)
- # babashka (23)
- # beginners (80)
- # calva (26)
- # chlorine-clover (11)
- # cljfx (4)
- # cljs-dev (12)
- # clojure (78)
- # clojure-berlin (5)
- # clojure-czech (3)
- # clojure-dev (9)
- # clojure-europe (45)
- # clojure-france (16)
- # clojure-gamedev (2)
- # clojure-italy (3)
- # clojure-nl (4)
- # clojure-spec (8)
- # clojure-sweden (1)
- # clojure-uk (37)
- # clojurescript (18)
- # community-development (15)
- # conjure (30)
- # cursive (51)
- # datomic (16)
- # duct (19)
- # figwheel-main (3)
- # fulcro (23)
- # java (7)
- # jobs (2)
- # joker (10)
- # off-topic (7)
- # parinfer (1)
- # pathom (6)
- # reagent (5)
- # reitit (1)
- # remote-jobs (1)
- # sci (1)
- # shadow-cljs (55)
- # slack-help (3)
- # specter (4)
- # sql (21)
- # tools-deps (11)
- # vim (5)
- # xtdb (14)
I've got this recurring problem where every few days my app breaks on calls into a node module with TypeError: $jscomp.inherits is not a function
and up until now I could always resolve it by bumping either CLJS versions or those of the node module, but now both are up to date and a few days in the error reappeared and I don't know what to do about it.
This link
https://github.com/google/closure-compiler/issues/2398
suggests the issue is somehow with the closure compiler - can anyone maybe shed some more light on this?
@d.eltzner012 its a polyfill issue. what is your setup? I'm presuming shadow-cljs? which :target
? which version?
yes - :target is :browser and version was 2.11.1, but I'm currently rerunning it with 2.11.4 to see if that suffices
if you want to get rid of it completely you can just set :compiler-options {:output-feature-set :es6}
(or :es7
, :es8
). depending on which older browsers you want to support
Okay, first version bumping shadow 'solved' it again, so thanks. Second, and sorry for my ignorance here, but I don't really see the connection - so I guess by default the output feature-set is by default set to something lower than es5 and that tends to be problematic somehow?
the default is :es5
which means if there are npm
packages that contain newer language features they are compiled down and polyfills are added
$jscomp
is those polyfills but sometimes they don't get added correctly for some reason
this might just be a bad cache for some reason. if it gets into that state again you can try deleting .shadow-cljs/builds/your-build
and restarting the watch
would help to have a reproducible case. I've been trying to fix this for a while now but can't quite figure out how it gets into a bad state 😞
I'd love to help but I obviously don't understand the circumstances either - I'm also quite the noob in JS-land so too much confusion here
Regarding the `infer-externs` compiler option: Are you intended to move the generated externs in `inferred_externs.js` to a file that you use for advanced compile? Or is it supposed to be enough to use type hinting and `infer-externs` when you use advanced compile?
I think I found the answer https://gist.github.com/swannodette/4fc9ccc13f62c66456daf19c47692799:
Simply add a new compiler option :infer-externs true to your compiler config. Now when you build your project you will get a new file in your :output-dir named inferred_externs.js. When you do an advanced build, this externs file will be used.
So, your `inferred_externs` should be in the `:output-dir` of your advanced build. Therefore, you might need to check it in to source control if your build is performed by an agent