Thanks!
https://gist.github.com/thheller/fa044450a6470fdd1afdbcf3f37a65e3
is another way
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?
*es6
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 š
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
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
$jscomp.inherits
is used for class Foo extends Bar
polyfilling I believe
so :es6
might be fine and that works in 98% of all browsers anyways
I see
I guess I'll go with es6 then. thanks again!
for your awesome stuff in general too obviously.
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
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?