kotlin multiplatform + react

南楼画角 提交于 2020-07-10 07:30:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!