You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[Is this an extension of the stock REPL or a fork?](#is-this-an-extension-of-the-stock-repl-or-a-fork)
60
60
*[Why do we ship a shaded copy of other libraries and not use dependencies?](#why-do-we-ship-a-shaded-copy-of-other-libraries-and-not-use-dependencies)
61
61
*[Where's the cache located on disk?](#wheres-the-cache-located-on-disk)
62
+
*[Why am I getting an AssertionError re `class module-info$` on first tab completion?](#why-am-i-getting-an-assertionerror-re-class-module-info-on-first-tab-completion)
@@ -573,6 +573,39 @@ srp includes some small libraries (e.g. most of the com-haoyili universe) that h
573
573
The cache? The caches you mean! :)
574
574
There's `~/.cache/scala-repl-pp` for the repl itself. Since we use coursier (via a subprocess) there's also `~/.cache/coursier`.
575
575
576
+
### Why am I getting an AssertionError re `class module-info$` on first tab completion?
577
+
```
578
+
exception caught when loading module class module-info$: java.lang.AssertionError: assertion failed: attempt to parse java.lang.Object from classfile
579
+
```
580
+
There's a [Scala 3 compiler bug](https://github.com/scala/scala3/issues/20421) that triggers and prints this exception if one of your dependencies ships a `module-info.class`. Until that's fixed you can use this hacky workaround in your sbt build:
581
+
```
582
+
lazy val removeModuleInfoFromJars = taskKey[Unit]("remove module-info.class from dependency jars - a hacky workaround for a scala3 compiler bug https://github.com/scala/scala3/issues/20421")
583
+
removeModuleInfoFromJars := {
584
+
import java.nio.file.{Files, FileSystems}
585
+
val logger = streams.value.log
586
+
val libDir = (Universal/stagingDirectory).value / "lib"
logger.info(s"workaround for scala completion bug: deleting $moduleInfoClass from $jar")
596
+
Files.delete(moduleInfoClass)
597
+
}
598
+
}
599
+
zipFs.close()
600
+
}
601
+
}
602
+
```
603
+
604
+
If you use [sbt-native-packager](https://sbt-native-packager.readthedocs.io/en/latest/) to package your application, you can automatically invoke the task, e.g. like so:
0 commit comments