which shadow-cljs version do you use? I vaguely remember something like this being fixed a rather long time ago?
I don't know the context of this error? is it happening in some npm code or on the CLJS side?
could be that the default :output-feature-set is just not high enough
maybe try wiping the .shadow-cljs/builds folder to clear caches
Hi, I was using 2.15.2 and in the meantime I found your message where you mention fix with js-options in version 2.16.4 and I'm trying to switch to it and deploy project as we speak
The only thing I'm actually unsure of is where to actually put the js-options
just into the build config? doesn't need to be in :dev or :release if it applies to both
This is happening while trying to use react-virtuoso npm package version 4.12.5
where it goes kinda depends on where it is needed. if its in some npm code then :js-options, otherwise :compiler-options
but it shouldn't be used manually either way 😛
but in those old versions you mentioned the closure compiler sometimes didn't correctly detect some used polyfills
so the fix is upgrading 😛 not working around it via :force-library-injection
Ok, at the moment it sits in release section, like this:
:release
{:asset-path "/assets/js/compiled"
:js-options {:force-library-injection #{"es6/util/makeiterator"}}
:build-options
{:ns-aliases
{day8.re-frame.tracing day8.re-frame.tracing-stubs}}}
Weird thing is that in dev section it worked with compiler options but in release it didn't, like this:
:dev
{:asset-path "/js/compiled"
:compiler-options
{:force-library-injection #{"es6/util/makeiterator"}....those old versions also had a rather low :output-feature-set :es6 which makes no sense unless you are actually writing code for 10 year old browsers 😛
delete :force-library-injection from your mind. it never worked properly. just forget it exists and move on.
it was a hacky work around for a problem in the closure compiler. it was temporary and is fixed nowadays.
it literally injects a polyfill for code that has been supported by browsers since before 2015
that is not useful today.
Ok, I'll forget it. 🙂 The code I'm writing is an admin system doesn't need to support very old browsers, so I really should invest little time in bringing shadow up to date.
you can just set :compiler-options {:output-feature-set :es-next}, which essentially just disables all polyfills
(that even works with the old version I believe)
Ok I will, thank you for your help, really apprecitate it!
Hi, I'm getting ("Uncaught TypeError: $jscomp.makeIterator is not a function") error and I found out from one of the messages that I have to inject makeIterator during build process. I managed go get it working for local development but I cannot get it working for release version. Any help is really appreciated. My shadow build config is attached above. Thank you!