https://kotlinlang.org logo
#ktor
Title
# ktor
c

Christian H.

03/22/2023, 12:17 PM
Hello. My kotlin multiplatform project is based on https://kotlinlang.org/docs/multiplatform-full-stack-app.html The application works in production mode, but throws the following JavaScript error on page load when I switch to development mode. It happens while trying to fetch data via REST via React's
Copy code
useEffectOnce {
    scope.launch {
        ...
    }
}
ReferenceError: Job is not defined at HttpClient (webpack-internal:///./kotlin/ktor-ktor-client-core-js-ir.js:599:24)
Dependency versions:
Copy code
val kotlinVersion = "1.8.0"
val kotlinxCoroutinesVersion = "1.6.4"
val serializationVersion = "1.3.3"
val ktorVersion = "2.0.3"
val logbackVersion = "1.2.11"
val kotlinWrappersVersion = "1.0.0-pre.354"
using js(IR) compiler Thanks for your help in advance!
1
e

e5l

03/22/2023, 12:17 PM
@anton.bannykh could you take a look?
🆗 1
loading 1
i

Ilya Goncharov [JB]

03/24/2023, 11:27 AM
@Christian H. Could you please try to clean project firstly and then rerun it? It can be problem in incremental compilation (and they should be fixed in following releases, and because I can’t reproduce it locally even on 1.8.0) or attach your project, and I can investigate it in details
🙌 1
c

Christian H.

03/24/2023, 3:07 PM
I invalidated IntelliJ Caches and did a whole project rebuild, also changed Gradle target jre from 17 to 18. The error does no longer occur and the application seems to be working fine in development and production mode. Thank you very much!
i

Ilya Goncharov [JB]

03/24/2023, 3:12 PM
I think
./gradlew clean
is enough in future cases We tried to fix all incremental-related problems in 1.8.20
2 Views