https://kotlinlang.org logo
#javascript
Title
# javascript
a

AndreiBogdan

07/10/2023, 6:20 AM
Hello. I have this setup
Copy code
js(IR) {
    moduleName = "kmm-lib"
    nodejs {
        binaries.library()
    }
    useCommonJs()
    generateTypeScriptDefinitions()
}
but i'm getting
Unresolved reference: generateTypeScriptDefinitions
when compiling it. Why would that be ? 😞 Is there something else that also needs to be configured ?!
a

Artem Kobzar

07/10/2023, 9:18 AM
Hello 👋 It could be that the version of the plugin doesn't contain the configuration method. As far as I remember, the method was provided in 1.8.20, so, if you use the gradle plugin with lower version - the method doesn't exist.
Could you please check what the version of compiler and Kotlin gradle plugin you use?
a

AndreiBogdan

07/10/2023, 9:27 AM
I've switched to
Copy code
val kotlin_version by extra("1.9.0")
and
Copy code
kotlin("multiplatform") version "1.9.0" apply false
and
Copy code
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0")
and
distributionUrl=https\:<//services.gradle.org/distributions/gradle-7.4.2-bin.zip>
🙁
should i perhaps increase 7.4.2 to something bigger ?
the thing is it offers autocomplete in Android Studio ... so it "has" it somewhere ... it's very strange. I'm sure i'm missing something, and olver version of ... something, but not sure what.
other ideas ? 😞
t

turansky

07/10/2023, 11:12 AM
I have similar problem with
1.9.0
in custom plugins. Kotlin DSL doesn’t work fine with Kotlin extensions. With Kotlin
1.8.20
works fine. Gradle
8.2.0
a

Artem Kobzar

07/10/2023, 11:33 AM
@Ilya Goncharov [JB] ^^
a

AndreiBogdan

07/10/2023, 12:57 PM
Copy code
Updated Android Studio to the latest version
Copy code
Downgraded from 1.9.0 to 1.8.22
Copy code
classpath("com.android.tools.build:gradle:8.0.2")
Copy code
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
Still throws an error on
Copy code
generateTypeScriptDefinitions
😞 Any other ideas ?!
what in the world is happening ?!
but NOW ... it doesn't even see the method, it doesn't autocomplete it anymore ... o.O
i

Ilya Goncharov [JB]

07/10/2023, 1:10 PM
Does it work just on simple project from wizard?
a

AndreiBogdan

07/10/2023, 3:49 PM
good question. i will check !
🙏 2
a

Ahmed Elzeiny

02/29/2024, 6:47 PM
@Ilya Goncharov [JB] I’m facing the same issue with kotlin 19.21 @AndreiBogdan did you solve it ?
a

AndreiBogdan

03/01/2024, 5:52 AM
I didn't. No. We scrapped the web side of the project entirely 😄 But in case you do figure out, please remember to come back here and post your solution. I'm quite curious what it could have been ...
7 Views