cfnz / muirwik

Muirwik - a Material UI React wrapper written in Kotlin
Mozilla Public License 2.0
132 stars 25 forks source link

IllegalArgumentException #70

Closed Pitel closed 3 years ago

Pitel commented 3 years ago

This is a bit WTF...

I've switched from my custom wrappers to this, fixes a few differences, and now I can't build my project:

> Task :compileKotlinJs FAILED
e: java.lang.IllegalArgumentException: Failed requirement.
        at org.jetbrains.kotlin.backend.common.serialization.IrDeclarationDeserializer.deserializeIrTypeAlias(IrDeclarationDeserializer.kt:368)
        at org.jetbrains.kotlin.backend.common.serialization.IrDeclarationDeserializer.deserializeDeclaration(IrDeclarationDeserializer.kt:752)
        at org.jetbrains.kotlin.backend.common.serialization.IrFileDeserializer.deserializeDeclaration(IrFileDeserializer.kt:39)
        at org.jetbrains.kotlin.backend.common.serialization.FileDeserializationState.deserializeAllFileReachableTopLevel(IrFileDeserializer.kt:139)
        at org.jetbrains.kotlin.backend.common.serialization.ModuleDeserializationState.deserializeReachableDeclarations(BasicIrModuleDeserializer.kt:172)
        at org.jetbrains.kotlin.backend.common.serialization.BasicIrModuleDeserializer.deserializeReachableDeclarations(BasicIrModuleDeserializer.kt:148)
        at org.jetbrains.kotlin.backend.common.serialization.KotlinIrLinker.deserializeAllReachableTopLevels(KotlinIrLinker.kt:102)
        at org.jetbrains.kotlin.backend.common.serialization.KotlinIrLinker.findDeserializedDeclarationForSymbol(KotlinIrLinker.kt:121)
        at org.jetbrains.kotlin.backend.common.serialization.KotlinIrLinker.getDeclaration(KotlinIrLinker.kt:159)

What I tired to fix this:

Do you have any idea how to fix this? I can reproduce it by simply changing git branches, one with my custom wrappers, one with this.

cfnz commented 3 years ago

Without looking into your problem in detail, just looking at the versions you are using - Kotlin react wrappers are currently undergoing a bit of an API cleanup. This has broken a few things going past Kotlin 1.5.0.

I had made the required changes to work with 1.5.20 but then the wrappers changed again with 1.5.21 with quite a few new changes required to get it going again.

I would say stick with version 1.5.0 and the wrapper version pre.204-kotlin-1.5.0 (as used in the starter project) if you can, and see if that solves your issues.

Pitel commented 3 years ago

Ok, I've played with the dependencies, and latest wrapper versions that works are 214.

com.ccfraser.muirwik:muirwik-components:0.8.2
+--- org.jetbrains.kotlin:kotlin-stdlib-js:1.5.0 -> 1.5.30-M1 (*)
+--- org.jetbrains.kotlin-wrappers:kotlin-react:17.0.2-pre.204-kotlin-1.5.0 -> 17.0.2-pre.214-kotlin-1.5.20 (*)
+--- org.jetbrains.kotlin-wrappers:kotlin-react-dom:17.0.2-pre.204-kotlin-1.5.0 -> 17.0.2-pre.214-kotlin-1.5.20 (*)
\--- org.jetbrains.kotlin-wrappers:kotlin-styled:5.3.0-pre.204-kotlin-1.5.0 -> 5.3.0-pre.214-kotlin-1.5.20 (*)