Mikhail Buzuverov
01/15/2022, 5:05 AMkvision-examples
and tried template-electron
. If I run task runApp
it is absolutely OK and the app works. But if I run task browserRun
the application starts on local port 3000, but app is not working, in browser's console I see error: require is not defined
. See screenshot. I don't modify code of example, it is my first checkpoint: run web variant and desktop variant of the app. Could you help me?Robert Jaros
01/15/2022, 6:02 AMRobert Jaros
01/15/2022, 6:02 AMRobert Jaros
01/15/2022, 6:03 AMtemplate-electron
application uses electron API, so you can not just run it in the browser.Robert Jaros
01/15/2022, 6:10 AMkvision-electron
module from build.gradle.kts
2. Add implementation(npm("electron", "^15.3.5"))
dependency (this is transitive dependency of the kvision module, so now you need to provide it manually)
3. Fix all compilation errors in the ElectronApp.kt
(this will remove all electron API usage from your app)
4. Remove (or comment) webpack.config.d/electron.js
fileRobert Jaros
01/15/2022, 6:11 AMbrowserRun
and runApp
gradle tasksRobert Jaros
01/15/2022, 6:14 AMbuild.gradle.kts
to make it work again:
rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin> {
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension>().ignoreScripts = false
}
Robert Jaros
01/15/2022, 6:14 AMMikhail Buzuverov
01/15/2022, 6:37 AM