shadow-cljs

Bryce Tichit 2025-09-17T14:01:34.853609Z

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 πŸ™‚ !

thheller 2025-09-17T19:22:41.296759Z

only question that comes to mind is why you are using an old shadow-cljs version?

thheller 2025-09-17T19:22:55.963579Z

newer version usually means newer closure compiler version and better JS support due to that

thheller 2025-09-17T19:24:03.627169Z

I suspect its related to your :resolve hacks

thheller 2025-09-17T19:24:42.797819Z

I'll take a look tomorrow

Bryce Tichit 2025-09-17T21:30:20.577699Z

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

Bryce Tichit 2025-09-17T21:31:03.848669Z

Thanks for taking the time to look at this! Much appreciated :)

Bryce Tichit 2025-09-19T10:46:06.937229Z

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 πŸ™‚

thheller 2025-09-19T06:26:50.724839Z

FWIW I tested with 3.2.0 and it works just fine without any :resolve hacks or any other config

thheller 2025-09-19T06:27:25.606519Z

{:target :browser
   :output-dir "public/js"
   :asset-path "/js"
   :modules {:main {:init-fn app.main/init}}}

thheller 2025-09-19T06:30:55.863219Z

and I did verify that it is caused by the :resolve trick. that code is causing trouble.

thheller 2025-09-19T06:32:02.756139Z

in particular the @radix-ui/react-collection one, not really sure what the problem is though

Marten Sytema 2025-09-17T18:58:25.106819Z

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?

thheller 2025-09-17T19:17:24.832909Z

pretty much yeah