问题
I have a project on kotlin multiplatform and want to use kotlin react for that. Added dependencies to build.gradle:
implementation("org.jetbrains:kotlin-react:16.13.0-pre.94-kotlin-1.3.70")
implementation("org.jetbrains:kotlin-react-dom:16.13.0-pre.94-kotlin-1.3.70")
implementation(npm("react", "16.13.1"))
implementation(npm("react-dom", "16.13.1"))
however i got a
Uncaught ReferenceError: module is not defined
in kotlin-react-dom.js and kotlin-react.js
i found that it because of core-js, which is not provided. How can i add it to my project with gradle?
my build.gradle https://pastebin.com/pGi1Au5L
回答1:
I have the same issue. Here said that you need to do npm i
in a folder with package.json. But the problem is that my package.json is generated by Gradle.
回答2:
I guess the problem was because of old project, I started a new one.
来源:https://stackoverflow.com/questions/62435482/kotlin-multiplatform-react