Search code examples
reactjsintellij-ideakotlinkotlin-jscreate-react-kotlin-app

Error getting while building react kotlin app using IntelliJ


I've created a simple react app using create-react-kotlin-app. After successful npm start, I tried to get a build of the project using IntelliJ IDEA's Build -> Build Project, but it fails stating

Error:(16, 44) Kotlin: Can't access property 'reactLogo' marked with @JsModule annotation from non-modular project

What am I missing here ?

NOTE: I haven't done any modification in the template comes with create-react-kotlin-app. The project runs successfully, problem only exist when I try to get a build.


Solution

  • I got managed to fix this issue via terminal.

    From the project root, run

    react-scripts-kotlin build
    

    This will automatically creates a build folder with production ready files.