Hello ! I've been running into an issue for the last few hours, I'm using a markdown editor package from npm which works well in dev but not in prod. The issue happens when I try to remove a character in the markdown editor (https://www.npmjs.com/package/@mdxeditor/editor?activeTab=dependents )
Lexical.prod.js:10 Uncaught ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor
at new Cj (Lexical.prod.js:10:4096)
at new previous (Lexical.prod.js:10:4096)
at Ri (Lexical.prod.js:10:4096)
at Oh (Lexical.prod.js:10:4096)
at od.deleteCharacter (Lexical.prod.js:10:4096)
at Array. (LexicalRichText.prod.js:10:4096)
at Lexical.prod.js:10:4096
at Ac (Lexical.prod.js:10:4096)
at Lexical.prod.js:10:4096
at Ee (Lexical.prod.js:10:4096)
Obviously it seems like an issue with advanced optimizations of Closure compiler since the issue is only when using release, but I can't find an efficient workaround for that. The issue seems to be with a dependency of the md editor named Lexical, I tried to rewrite some of its code with babel but did not work ! (maybe I did not do it correctly but it was getting quite messy)
https://mdx-editor-helloworld.vercel.app/
https://github.com/Akaban/mdx-editor-helloworld
It's easy to see that we can remove characters using shadow-cljs compile but not using shadow-cljs release
Any ideas? Thanks a lot for the help π !only question that comes to mind is why you are using an old shadow-cljs version?
newer version usually means newer closure compiler version and better JS support due to that
I suspect its related to your :resolve hacks
I'll take a look tomorrow
Good catch yes I did not mention that I had to hack a little bit to get it working even in dev. Also Iβm using that old version for now because it seems that Vercel do not have the java version needed to run the last shadow-cljs version, might be able to find a work around but anyways even when using the last version I had the same behavior
Thanks for taking the time to look at this! Much appreciated :)
Thanks a lot for your time ! Upgrading to 3.2.0, removing :resolve and removing target es-next did the trick indeed. All good now π
FWIW I tested with 3.2.0 and it works just fine without any :resolve hacks or any other config
{:target :browser
:output-dir "public/js"
:asset-path "/js"
:modules {:main {:init-fn app.main/init}}}and I did verify that it is caused by the :resolve trick. that code is causing trouble.
in particular the @radix-ui/react-collection one, not really sure what the problem is though
Quick question:
I have a clojurescript app that people can embed in their website. Now I have seen a Wix website where the Wix runtime wipes the DOM now and again.
I would therefore be able to re-run the script by basically calling itβs main function
Does this simply work by adding ^:export to the function?
And then, will it be like my.namespace.mymainfunction(); to call it?
pretty much yeah