Unresolved reference when compiling with JS IR backend
See original GitHub issueIf importing kodein-di
version 7.3.1
or 7.4.0-master-113
and targetting JS with new IR compilation backend, the compiler errors with Unresolved reference: kodein
.
The compiler do not find any reference to Kodein at all!
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
unable to build js target using IR backend · Issue #876 - GitHub
Describe the bug When using the IR backend for building JS target, ... the build : > Task :compileKotlinJs FAILED Unresolved reference: org ......
Read more >Kotlin JS: ICE caused by unresolved external class : KT-49763
I had an unresolved external class (I moved it and hadn't updated the imports yet), and in addition to the expected compilation errors,...
Read more >JS IR compiler not compatible with kotlinx.serialization?
Unresolved reference : KSerializer etc… A comment on this bug says serialization 1.0.0-RC is compatible with the Kotlin/JS IR compiler.
Read more >Migrating our Kotlin/JS app to the new IR compiler
I recently migrated its frontend which you can see below (and which is using the kotlin-react wrappers) to the new Kotlin/JS IR compiler...
Read more >Kotlin Multiplatform project building keeps failing after adding ...
JsIrBackendContext.<init>(JsIrBackendContext.kt:49) at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compile(compiler.kt:94) at ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Due to a bug in the Kotlin JS IR compiler before 1.4.30, Kodein-DI is not compatible with Kotlin IR compilers before 1.4.30.
In commit 3c825ea, the Kotlin version used by the project is defined by Gradle, rather than by the property set in the gradle.properties file. The project is therefore compiled with Kotlin 1.4.21, but uses Kotlin-stdlib 1.4.30 (hence the warnings we can see int the build log).
Setting the Kotlin version manually in
buildSrc/build.gradle.kts
to 1.4.30 fixes the issue and allows kotlingram to build correctly.Somehow using
js(BOTH)
was misconfiguring the task graph and task:api:core:generateTelegramApi
was not being executed before:api:core:compilekotlinJsIr
. Fixed with commit3c825ea
.Now the bug should be reproducible always.