https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
r

Rohan Maity

09/26/2021, 11:20 AM
Hello, I am working on Multiplatform project targeting
android, iOS and Web
For the web app somehow my generated JS file is getting blocked
Copy code
The resource was blocked due to MIME type ("text/html") mismatch (X-Content-Type-Options: nosniff).
I have just done the simple
Hello world
only, Its working on android and iOS has anyone encountered the same issue ? Any help here would be appreciated More info in replies
This is the code in main.kt for
webApp
Copy code
fun main() {
    document.bgColor = "red"
    console.log(Greeting().greeting())
}
and
Greeting()
is the class present in
commonMain
in sharedModule
c

CLOVIS

09/26/2021, 12:03 PM
Your file is a
.js
but the error complains that it's HTML. What is your config?
r

Rohan Maity

09/26/2021, 12:09 PM
Hello clovis, I found the root cause of this. Actually when in multiplatform setup, Kotlin does not generate the name properly in
webpack.config.js
Generated
JS
file and filename set in
webpack.config.js
was different, so thats why it caused the issue Later I found out I could change the output file name for
webpack.config.js
in dsl so after changing the to proper name in dsl it was working More info can found here: https://kotlinlang.slack.com/archives/C0B8L3U69/p1632656555392900
c

CLOVIS

09/26/2021, 12:42 PM
That sounds like a bug. You should probably report it at https://kotl.in/issue
r

Rohan Maity

09/26/2021, 12:43 PM
Yeah sure
4 Views