question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unresolved reference when compiling with JS IR backend

See original GitHub issue

If 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:closed
  • Created 3 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
SalomonBryscommented, Feb 23, 2021

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.

plugins {
    `kotlin-dsl`
    kotlin("jvm") version "1.4.30"
}
0reactions
lamba92commented, Feb 17, 2021

Somehow using js(BOTH) was misconfiguring the task graph and task :api:core:generateTelegramApi was not being executed before :api:core:compilekotlinJsIr. Fixed with commit 3c825ea.

Now the bug should be reproducible always.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found