Hello, I am working on Multiplatform project targe...
# multiplatform
r
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
Your file is a
.js
but the error complains that it's HTML. What is your config?
r
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
That sounds like a bug. You should probably report it at https://kotl.in/issue
r
Yeah sure