Can anyone provide any insight on what causes this...
# javascript
a
Can anyone provide any insight on what causes this issue, I’m trying to build a project with IR
Copy code
> Task :idmapi-entrypoints:compileProductionExecutableKotlinJs FAILED
e: java.lang.IllegalStateException: Not found Idx for private com.mypackage/|null[0]:40
        at org.jetbrains.kotlin.backend.common.serialization.IrFileDeserializer.loadTopLevelDeclarationProto(IrFileDeserializer.kt:48)
        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)
com.mypackage
is another of my projects that this project depends on i have also compiled it with
js(IR)
but the issue could be that i’m still missing something there but its unclear from this error
t
Do you use similar Kotlin versions for projects?
a
it looks like all my projects are using the
1.5.31
gradle plugin it does look like there might be a minor version difference with
org.jetbrains.kotlinx:kotlinx-serialization-json
with
1.2.1
&
1.3.0
Do yo know what this error means?
t
Could you sync runtime versions?
1.3.0
for both
Do yo know what this error means?
Non-synchronized versions - first candidate
a
I can do that, but in the interim i connected a debugger and the detailed message from there is
NPM dependencies should be resolved
All of these ideas were wrong! The issue was
Copy code
private const val A_CONST = 100

expect class MyClient(env: Deferred<Map<String, String>>) {
  fun myMethod(aParam: Int = A_CONST)
}
This code generated a module_0 file that just contained the constant and nothing else. Removing the constant and replacing with the following fixed it
Copy code
expect class MyClient(env: Deferred<Map<String, String>>) {
  fun myMethod(aParam: Int = 100)
}
I think this is probably an IR/JS bug?
t
Looks like bug
a
been having this bug of default parameters as well.
a
Is there a ticket for this one I couldn’t find it?