Thread
#multiplatform
    Rohan Maity

    Rohan Maity

    1 year ago
    Hello, I am working on Multiplatform project targeting
    android, iOS and Web
    For the web app somehow my generated JS file is getting blocked
    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
    fun main() {
        document.bgColor = "red"
        console.log(Greeting().greeting())
    }
    and
    Greeting()
    is the class present in
    commonMain
    in sharedModule
    c

    CLOVIS

    1 year ago
    Your file is a
    .js
    but the error complains that it's HTML. What is your config?
    Rohan Maity

    Rohan Maity

    1 year ago
    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

    1 year ago
    That sounds like a bug. You should probably report it at https://kotl.in/issue
    Rohan Maity

    Rohan Maity

    1 year ago
    Yeah sure