-
Notifications
You must be signed in to change notification settings - Fork 395
Regression in v1.19.0: AssertionError with module splitting on and optimizer off. #5159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the report. Could you provide a full reproduction, with the code that triggers this issue? |
@gzm0 I guess we're missing a call to scala-js/linker/shared/src/main/scala/org/scalajs/linker/analyzer/Analyzer.scala Lines 1488 to 1491 in b53a090
which would mimic what we do for "normal" class instantiations here: scala-js/linker/shared/src/main/scala/org/scalajs/linker/analyzer/Analyzer.scala Lines 1431 to 1434 in b53a090
I wonder how this was not caught at all by our CI? |
I'm not sure we test module splitting w/o optimizer (IIUC we can only get to this w/o optimizer, otherwise the module splitter uses the post optimizer analysis, which will see the synthesized versions. |
Huh, yes, that's it. Module splitting + So @guillaug: as workaround, re-enable the optimizer in |
Fix #5159: Register static module dependency on used lambda classes.
Ok thanks for the fix ! I used |
Vite has a JS minifier. It doesn't have Scala.js optimizer that uses types to perform advanced optimizations. If you did not measure, I suspect disabling the optimizer made the setup slower. Without optimizer, Scala.js generates a lot more JS code, which means that much more to reload in the browser. The Scala.js optimizer is incremental and so it is extremely fast in the development cycle. Usually the fact that it produces smaller and faster code improves dev iteration time.
Source maps are enabled by default, though I've heard it's tricky to get them to work well when additional tools work after Scala.js (such as Vite). Here as well, the optimizer shouldn't make a difference between "they work" and "they don't work". It may deteriorate the quality of the debugging experience somewhat, though. That's usually a good reason to temporarily disable the optimizer as you're debugging something. |
Scala version : 3.7.0-RC4
ScalaJS version : 1.19.0
Error happens with config
ModuleSplitStyle.SmallModulesFor(...)
orModuleSplitStyle.ModuleSplitStyle.SmallestModules
.Does not happen with config
ModuleSplitStyle.FewestModules
Error is thrown when running
fastLinkJS
but notfullLinkJS
.The text was updated successfully, but these errors were encountered: