Can anyone help me make sense of this serializatio...
# serialization
v
Can anyone help me make sense of this serialization & javascript compiler error?
Copy code
2022-01-25T21:03:42.507+0000 [DEBUG] [org.gradle.execution.plan.Node] Checking if all dependencies are complete for :jsProductionExecutableCompileSync
2022-01-25T21:03:42.507+0000 [DEBUG] [org.gradle.execution.plan.Node] All dependencies are complete for :jsProductionExecutableCompileSync
2022-01-25T21:03:42.507+0000 [DEBUG] [org.gradle.execution.plan.TaskNode] Checking if all must successors are complete for :jsProductionExecutableCompileSync
java.util.NoSuchElementException: Collection contains no element matching the predicate.
	at org.jetbrains.kotlinx.serialization.compiler.backend.ir.IrBuilderExtension$DefaultImpls.createLazyProperty(GeneratorHelpers.kt:1401)
	at org.jetbrains.kotlinx.serialization.compiler.backend.ir.SerializableCompanionIrGenerator.createLazyProperty(SerializableCompanionIrGenerator.kt:35)
	at org.jetbrains.kotlinx.serialization.compiler.backend.ir.SerializableCompanionIrGenerator.generateLazySerializerGetter(SerializableCompanionIrGenerator.kt:114)
	at org.jetbrains.kotlinx.serialization.compiler.backend.common.SerializableCompanionCodegen.generate(SerializableCompanionCodegen.kt:37)
	at org.jetbrains.kotlinx.serialization.compiler.backend.ir.SerializableCompanionIrGenerator$Companion.generate(SerializableCompanionIrGenerator.kt:50)
	at org.jetbrains.kotlinx.serialization.compiler.extensions.SerializerClassLowering.lower(SerializationLoweringExtension.kt:60)
...
	at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1802)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
I have code which runs and compiles fine on the JVM, but fails when compiling to Javascript. The error logs don't tell me where in my code it's failing. If it helps, my data model to be serialized has a
sealed
class with a number of children, each of which implement different interfaces. None of them use
by lazy
.
I'm trying to create a minimal reproducer project but no luck so far. Simpler projects are working fine.
d
Are you using generics?
v
No. There are maps and lists of things, of course. But none of my classes use generics. It's all sealed, data, and abstract classes.