I've enountered a problem using shadow-cljs "release" compilation with a new version of the lexical npm library (0.25.0). The previous version worked fine (0.24.0), and development builds are ok, but release compilation with any optimization level produces js that generates exceptions in the browser. The browser exceptions are happening when characters are deleted within the editor widget from the lexical library and have the message "ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor". I've created a example repo which reproduces the error https://github.com/grahamcarlyle/shadowcljs-lexical-0.25.0-bug
are you sure this is not due to some API changes? i.e. the newer version expecting to be passed different props or so?
I don't think so, the example is pretty minimal and corresponds to their "getting started" example. This https://github.com/facebook/lexical/pull/7047 might be relevant as it suggests they might be producing their prod build differently
that would have been my next guess. the package contains a bunch of .prod.js files that the watch/compile builds do not use
I'll check in a bit whether it works if the release build also uses the "dev" files
yep, confirmed it. it is a problem on the library side. the build seems to be broken.
you can change the config to
{:deps true
:dev-http {8080 "public"}
:builds
{:frontend
{:target :browser
:js-options {:export-conditions ["development" "browser" "require" "default" "module" "import"]}
:modules {:main {:init-fn }}}}} that fixes it. if you replace the "development" with "production" it breaks again completely, cause watch/compile will then also use the .prod.js files
can't say if its the library itself, or the processing the closure compiler does with it
but there is something off on the production files
hmm, tested another thing removing the :js-options and just setting :compiler-options {:output-feature-set :es-unsupported}. this also seems to fix it. it basically turns off any transpiling the closure compiler may attempt. so maybe the bug is indeed in the closure compiler
nothing I can fix from the shadow-cljs side I'm afraid
> "ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor".
I never got that error though. only Uncaught TypeError: Q is not a function.
Yes thatโs the error I see in the console too, but if I pause on the exception in chrome devtools then the underlying error seems to be the reference error
Thanks for looking into it ๐