-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
I tried to add the kotlinx.html dependency for JS compilation. It seems to work ok with legacy compilation, but IR compilation is not resolving the import.
Steps:
- Add
maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
at L62 build.gradle.kts - Add
kotlinJsDependency("org.jetbrains.kotlinx:kotlinx-html-js:0.7.5")
at L89 build.gradle.kts - This caused a duplicates error so I added
duplicatesStrategy = DuplicatesStrategy.INCLUDE
at L42 build.gradle.kts - I then built with
./gradlew build -x test
and ran with./gradlew bootRun
Non IR curl works
curl --request POST \
--url 'http://localhost:8080/api/compiler/translate?ir=false' \
--header 'content-type: application/json' \
--data '{
"files": [
{
"name": "File.kt",
"text": "import kotlinx.html.div\n\nfun main() {\n println(\"test123\")\n }"
}
]
}'
But the IR one doesn't
curl --request POST \
--url 'http://localhost:8080/api/compiler/translate?ir=true' \
--header 'content-type: application/json' \
--data '{
"files": [
{
"name": "File.kt",
"text": "import kotlinx.html.div\n\nfun main() {\n println(\"test123\")\n }"
}
]
}'
The response was
{
"jsCode": null,
"exception": {
"message": "UNRESOLVED_REFERENCE: Unresolved reference: html (1,16) in /File.kt",
"fullName": "java.lang.IllegalStateException",
"stackTrace": [
{
"className": "org.jetbrains.kotlin.diagnostics.DiagnosticSink$2",
"methodName": "report",
"fileName": "DiagnosticSink.java",
"lineNumber": 46
},
{
"className": "org.jetbrains.kotlin.resolve.AnalyzingUtils",
"methodName": "throwExceptionOnErrors",
"fileName": "AnalyzingUtils.kt",
"lineNumber": 63
},
{
"className": "org.jetbrains.kotlin.resolve.AnalyzingUtils",
"methodName": "throwExceptionOnErrors",
"fileName": "AnalyzingUtils.kt",
"lineNumber": 58
}
],
"cause": null,
"localizedMessage": null
},
"errors": {
},
"text": ""
}
I tried with both 1.7.0-RC2 and 1.6.21
I was also wondering is it possible to configure the JS compiler to bundle all necessary dependencies into the jsCode output?
Metadata
Metadata
Assignees
Labels
No labels