cfnz / muirwik

Muirwik - a Material UI React wrapper written in Kotlin
Mozilla Public License 2.0
132 stars 25 forks source link

Upgrade failure #68

Closed theromis closed 3 years ago

theromis commented 3 years ago

Trying to upgrade to kotlin 1.5.20 + latest wrappers, but getting this:

romans-mbp-2.lan 01:53:58.030 > lonjechat_kotlin git:(master) ✗ ./gradlew browserDevelopmentRun

> Configure project :app
WARNING:: Using flatDir should be avoided because it doesn't support any meta-data formats.

The following Kotlin source sets were configured but not added to any Kotlin compilation:
 * androidAndroidTestRelease
 * cio
 * cioNoWebRTC
 * direct
 * okhttp
 * okhttpTracing
You can add a source set to a target's compilation by connecting it with the compilation's default source set using 'dependsOn'.
See https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#connecting-source-sets

> Task :kotlinNpmInstall
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > react-responsive@8.2.0" has unmet peer dependency "react@>=16.8.0".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > react-virtuoso@1.9.3" has unmet peer dependency "react@>=16".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > react-virtuoso > @virtuoso.dev/react-urx@0.2.6" has unmet peer dependency "react@>=16".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core@4.12.1" has unmet peer dependency "react@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core@4.12.1" has unmet peer dependency "react-dom@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/lab@4.0.0-alpha.56" has unmet peer dependency "react@^16.8.0".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/lab@4.0.0-alpha.56" has unmet peer dependency "react-dom@^16.8.0".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/icons@4.11.2" has unmet peer dependency "react@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/icons@4.11.2" has unmet peer dependency "react-dom@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core > @material-ui/styles@4.11.4" has unmet peer dependency "react@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core > @material-ui/styles@4.11.4" has unmet peer dependency "react-dom@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core > @material-ui/system@4.12.1" has unmet peer dependency "react@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core > @material-ui/system@4.12.1" has unmet peer dependency "react-dom@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core > @material-ui/utils@4.11.2" has unmet peer dependency "react@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core > @material-ui/utils@4.11.2" has unmet peer dependency "react-dom@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core > react-transition-group@4.4.2" has unmet peer dependency "react@>=16.6.0".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core > react-transition-group@4.4.2" has unmet peer dependency "react-dom@>=16.6.0".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > kotlin-wrappers-kotlin-styled-js-ir > styled-components@5.3.0" has unmet peer dependency "react@>= 16.8.0".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > kotlin-wrappers-kotlin-styled-js-ir > styled-components@5.3.0" has unmet peer dependency "react-dom@>= 16.8.0".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > kotlin-wrappers-kotlin-styled-js-ir > styled-components@5.3.0" has unmet peer dependency "react-is@>= 16.8.0".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > kotlin-wrappers-kotlin-react-dom-js-ir > react-dom@17.0.2" has unmet peer dependency "react@17.0.2".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > kotlin-wrappers-kotlin-react-redux-js-ir > react-redux@7.2.4" has unmet peer dependency "react@^16.8.3 || ^17".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > kotlin-wrappers-kotlin-react-router-dom-js-ir > react-router-dom@5.2.0" has unmet peer dependency "react@>=15".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > kotlin-wrappers-kotlin-react-router-dom-js-ir > react-router-dom > react-router@5.2.0" has unmet peer dependency "react@>=15".
warning "workspace-aggregator-b90bd596-d235-475d-b7b5-fa9c5fe058b2 > Lonje-reactJs > kotlin-wrappers-kotlin-react-router-dom-js-ir > react-router-dom > react-router > mini-create-react-context@0.4.1" has unmet peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0".

> Task :reactJs:compileKotlinJs
w: /Users/roman/work/lonjechat_kotlin/reactJs/src/main/kotlin/App.kt: (730, 21): Parameter 'index' is never used
w: /Users/roman/work/lonjechat_kotlin/reactJs/src/main/kotlin/App.kt: (767, 25): Parameter 'index' is never used
w: /Users/roman/work/lonjechat_kotlin/reactJs/src/main/kotlin/App.kt: (1198, 31): Parameter 'handler' is never used
w: /Users/roman/work/lonjechat_kotlin/reactJs/src/main/kotlin/components/header/Header.kt: (82, 31): Parameter 'reason' is never used
w: /Users/roman/work/lonjechat_kotlin/reactJs/src/main/kotlin/containers/DetailContainer.kt: (662, 11): Parameter 'dispatch' is never used, could be renamed to _
w: /Users/roman/work/lonjechat_kotlin/reactJs/src/main/kotlin/containers/MasterContainer.kt: (255, 11): Parameter 'dispatch' is never used, could be renamed to _

> Task :reactJs:compileDevelopmentExecutableKotlinJs FAILED
e: java.lang.IllegalStateException: Symbol for public react/RBuilder.child|704725676889942833[0] is unbound
        at org.jetbrains.kotlin.ir.symbols.impl.IrBindablePublicSymbolBase.getOwner(IrPublicSymbolBase.kt:52)
        at org.jetbrains.kotlin.ir.symbols.impl.IrPublicSymbolBase.getDescriptor(IrPublicSymbolBase.kt:23)
        at org.jetbrains.kotlin.backend.common.serialization.KotlinIrLinker.findDeserializedDeclarationForSymbol(KotlinIrLinker.kt:117)
        at org.jetbrains.kotlin.backend.common.serialization.KotlinIrLinker.getDeclaration(KotlinIrLinker.kt:162)
        at org.jetbrains.kotlin.ir.util.ExternalDependenciesGeneratorKt.getDeclaration(ExternalDependenciesGenerator.kt:61)
        at org.jetbrains.kotlin.ir.util.ExternalDependenciesGenerator.generateUnboundSymbolsAsDependencies(ExternalDependenciesGenerator.kt:48)
        at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compile(compiler.kt:80)
        at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compile$default(compiler.kt:36)
        at org.jetbrains.kotlin.cli.js.K2JsIrCompiler.doExecute(K2JsIrCompiler.kt:256)
        at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:182)
        at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:75)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:90)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
        at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1575)
        at jdk.internal.reflect.GeneratedMethodAccessor101.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
        at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
        at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':reactJs:compileDevelopmentExecutableKotlinJs'.
> Internal compiler error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 14s
12 actionable tasks: 7 executed, 5 up-to-date

This reactJs in kotlin mpp, here is some partial configs:

reactJs/build.gradle.kts

plugins {
    kotlin("js")
//    id("com.github.node-gradle.node") version "3.1.0"
}
group = "me.roman"
version = "1.0-SNAPSHOT"
kotlin {
    js {
        useCommonJs()
        binaries.executable()
        browser {
            webpackTask {
                cssSupport.enabled = true
            }
            runTask {
                cssSupport.enabled = true
            }
            testTask {
                useKarma {
                    useChromeHeadless()
                    webpackConfig.cssSupport.enabled = true
                }
            }
        }
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation(npm("react-responsive", "8.2.0"))
    implementation(npm("react-virtuoso", "1.9.3"))
    implementation("com.ccfraser.muirwik:muirwik-components:0.8.0")

    implementation(project(":LonjeShared"))
    implementation("org.jetbrains.kotlin-wrappers:kotlin-react:17.0.2-pre.215-kotlin-1.5.20")
    implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom:17.0.2-pre.215-kotlin-1.5.20")
    implementation("org.jetbrains.kotlin-wrappers:kotlin-react-router-dom:5.2.0-pre.215-kotlin-1.5.20")
    implementation("org.jetbrains.kotlin-wrappers:kotlin-react-redux:7.2.4-pre.215-kotlin-1.5.20")
    implementation("org.jetbrains.kotlin-wrappers:kotlin-styled:5.3.0-pre.215-kotlin-1.5.20")

    implementation("org.jetbrains.kotlinx:kotlinx-html-js:0.7.3")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1")
}
gradle.properties

org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
android.useAndroidX=true
android.enableJetifier=true
kotlin.code.style=official
kotlin.js.experimental.generateKotlinExternals=true
kotlin.js.compiler=ir
kotlin.mpp.stability.nowarn=true

kotlinVersion = 1.5.20
ktorVersion = 1.6.1

just duplicating https://github.com/JetBrains/kotlin-wrappers/issues/517

theromis commented 3 years ago

trying pre.204 still fails: for legacy it just hags here

> Task :reactJs:browserDevelopmentRun
⚠ 「wdm」: asset reactJs.js 42.8 MiB [emitted] (name: main)
656 modules
webpack 5.27.1 compiled successfully in 9998 ms
<============-> 94% EXECUTING [23m 17s]
> :reactJs:browserDevelopmentRun > webpack 5.27.1 compiled successfully in 9998 ms
^C%

can connect manully in the browser getting:

regex.kt?9f55:54 Uncaught SyntaxError: Invalid regular expression: /[a-zA-Z0-9\+\.\_\%\-\+]{1,256}\@[a-zA-Z0-9][a-zA-Z0-9\-]{0,64}(\.[a-zA-Z0-9][a-zA-Z0-9\-]{0,25})+/: Invalid escape
    at new RegExp (<anonymous>)
    at Regex (regex.kt?9f55:54)
    at Regex_init_0 (regex.kt?9f55:47)
    at eval (check.kt?3c1f:3)
    at eval (Lonje-LonjeShared.js:22979)
    at Object../kotlin-dce-dev/Lonje-LonjeShared.js (reactJs.js:6564)
    at __webpack_require__ (reactJs.js:6870)
    at eval (Lonje-reactJs.js:12265)
    at Object../kotlin-dce-dev/Lonje-reactJs.js (reactJs.js:6574)
    at __webpack_require__ (reactJs.js:6870)

for IR:

kotlin.js.compiler=ir
> Task :reactJs:compileDevelopmentExecutableKotlinJs FAILED
e: java.lang.NullPointerException
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrElementToJsExpressionTransformer.visitCall(IrElementToJsExpressionTransformer.kt:200)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrElementToJsExpressionTransformer.visitCall(IrElementToJsExpressionTransformer.kt:23)
        at org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl.accept(IrCallImpl.kt:47)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrElementToJsExpressionTransformer.visitTypeOperator(IrElementToJsExpressionTransformer.kt:242)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrElementToJsExpressionTransformer.visitTypeOperator(IrElementToJsExpressionTransformer.kt:23)
        at org.jetbrains.kotlin.ir.expressions.impl.IrTypeOperatorCallImpl.accept(IrTypeOperatorCallImpl.kt:40)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsAstUtilsKt.jsVar(jsAstUtils.kt:21)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrElementToJsStatementTransformer.visitVariable(IrElementToJsStatementTransformer.kt:97)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrElementToJsStatementTransformer.visitVariable(IrElementToJsStatementTransformer.kt:18)
        at org.jetbrains.kotlin.ir.declarations.impl.IrVariableImpl.accept(IrVariableImpl.kt:74)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrElementToJsStatementTransformer.visitBlockBody(IrElementToJsStatementTransformer.kt:28)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrElementToJsStatementTransformer.visitBlockBody(IrElementToJsStatementTransformer.kt:18)
        at org.jetbrains.kotlin.ir.expressions.IrBlockBody.accept(IrBody.kt:54)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsAstUtilsKt.translateFunction(jsAstUtils.kt:55)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrFunctionToJsTransformer.visitSimpleFunction(IrFunctionToJsTransformer.kt:22)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrFunctionToJsTransformer.visitSimpleFunction(IrFunctionToJsTransformer.kt:14)
        at org.jetbrains.kotlin.ir.declarations.IrSimpleFunction.accept(IrSimpleFunction.kt:29)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsClassGenerator.generateMemberFunction(JsClassGenerator.kt:155)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsClassGenerator.generate(JsClassGenerator.kt:82)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrDeclarationToJsTransformer.visitClass(IrDeclarationToJsTransformer.kt:28)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrDeclarationToJsTransformer.visitClass(IrDeclarationToJsTransformer.kt:12)
        at org.jetbrains.kotlin.ir.declarations.IrClass.accept(IrClass.kt:56)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrFileToJsTransformer.visitFile(IrFileToJsTransformer.kt:19)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrFileToJsTransformer.visitFile(IrFileToJsTransformer.kt:13)
        at org.jetbrains.kotlin.ir.declarations.impl.IrFileImpl.accept(IrFileImpl.kt:63)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrModuleToJsTransformer.generateModuleBody(IrModuleToJsTransformer.kt:255)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrModuleToJsTransformer.generateWrappedModuleBody2(IrModuleToJsTransformer.kt:148)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrModuleToJsTransformer.generateWrappedModuleBody(IrModuleToJsTransformer.kt:110)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrModuleToJsTransformer.generateModule(IrModuleToJsTransformer.kt:61)
        at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compile(compiler.kt:128)
        at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compile$default(compiler.kt:38)
        at org.jetbrains.kotlin.cli.js.K2JsIrCompiler.doExecute(K2JsIrCompiler.kt:257)
        at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:181)
        at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:74)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:88)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
        at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1575)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
        at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
        at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':reactJs:compileDevelopmentExecutableKotlinJs'.
> Internal compiler error. See log for more details

for now I will revert back to kotlin 1.4.21 and pre.135-kotlin-1.4.21 at list will finish my development

cfnz commented 3 years ago

1.5.0 should work with pre.204 wrappers for IR and Legacy compiler as in the test app and the starter app, and this is the latest version combination you can get from maven central (Muirwik version 0.8.2).

theromis commented 3 years ago

Thank you for regex help, fixed it.

Updated build with pre.204 now legacy works, but IR still fails:

romans-mbp-2.lan 22:55:15.405 > lonjechat_kotlin git:(master) ✗ ./gradlew browserDevelopmentRun

> Configure project :app
WARNING:: Using flatDir should be avoided because it doesn't support any meta-data formats.

The following Kotlin source sets were configured but not added to any Kotlin compilation:
 * androidAndroidTestRelease
 * cio
 * cioNoWebRTC
 * direct
 * okhttp
 * okhttpTracing
You can add a source set to a target's compilation by connecting it with the compilation's default source set using 'dependsOn'.
See https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#connecting-source-sets

> Task :kotlinNpmInstall
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > react-responsive@8.2.0" has unmet peer dependency "react@>=16.8.0".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > react-virtuoso@1.9.1" has unmet peer dependency "react@>=16".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > react-virtuoso > @virtuoso.dev/react-urx@0.2.6" has unmet peer dependency "react@>=16".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core@4.11.1" has unmet peer dependency "react@^16.8.0".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core@4.11.1" has unmet peer dependency "react-dom@^16.8.0".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/lab@4.0.0-alpha.56" has unmet peer dependency "react@^16.8.0".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/lab@4.0.0-alpha.56" has unmet peer dependency "react-dom@^16.8.0".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/icons@4.9.1" has unmet peer dependency "react@^16.8.0".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/icons@4.9.1" has unmet peer dependency "react-dom@^16.8.0".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core > @material-ui/styles@4.11.4" has unmet peer dependency "react@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core > @material-ui/styles@4.11.4" has unmet peer dependency "react-dom@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core > @material-ui/system@4.12.1" has unmet peer dependency "react@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core > @material-ui/system@4.12.1" has unmet peer dependency "react-dom@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core > @material-ui/utils@4.11.2" has unmet peer dependency "react@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core > @material-ui/utils@4.11.2" has unmet peer dependency "react-dom@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core > react-transition-group@4.4.2" has unmet peer dependency "react@>=16.6.0".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > muirwik-muirwik-components-js-ir > @material-ui/core > react-transition-group@4.4.2" has unmet peer dependency "react-dom@>=16.6.0".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > kotlin-wrappers-kotlin-react-dom-js-ir > react-dom@17.0.2" has unmet peer dependency "react@17.0.2".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > kotlin-wrappers-kotlin-styled-js-ir > styled-components@5.3.0" has unmet peer dependency "react@>= 16.8.0".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > kotlin-wrappers-kotlin-styled-js-ir > styled-components@5.3.0" has unmet peer dependency "react-dom@>= 16.8.0".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > kotlin-wrappers-kotlin-styled-js-ir > styled-components@5.3.0" has unmet peer dependency "react-is@>= 16.8.0".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > kotlin-wrappers-kotlin-react-router-dom-js-ir > react-router-dom@5.2.0" has unmet peer dependency "react@>=15".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > kotlin-wrappers-kotlin-react-router-dom-js-ir > react-router-dom > react-router@5.2.0" has unmet peer dependency "react@>=15".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > kotlin-wrappers-kotlin-react-router-dom-js-ir > react-router-dom > react-router > mini-create-react-context@0.4.1" has unmet peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0".
warning "workspace-aggregator-24fce1e3-58e7-4882-8194-71e189b84995 > Lonje-reactJs > kotlin-wrappers-kotlin-react-redux-js-ir > react-redux@7.2.4" has unmet peer dependency "react@^16.8.3 || ^17".

> Task :reactJs:compileKotlinJs
w: source-map argument is not supported yet
w: /Users/roman/work/lonjechat_kotlin/reactJs/src/main/kotlin/App.kt: (732, 21): Parameter 'index' is never used
w: /Users/roman/work/lonjechat_kotlin/reactJs/src/main/kotlin/App.kt: (769, 25): Parameter 'index' is never used
w: /Users/roman/work/lonjechat_kotlin/reactJs/src/main/kotlin/App.kt: (1229, 31): Parameter 'handler' is never used
w: /Users/roman/work/lonjechat_kotlin/reactJs/src/main/kotlin/components/header/Header.kt: (82, 31): Parameter 'reason' is never used
w: /Users/roman/work/lonjechat_kotlin/reactJs/src/main/kotlin/containers/DetailContainer.kt: (662, 11): Parameter 'dispatch' is never used, could be renamed to _
w: /Users/roman/work/lonjechat_kotlin/reactJs/src/main/kotlin/containers/MasterContainer.kt: (255, 11): Parameter 'dispatch' is never used, could be renamed to _

> Task :reactJs:compileDevelopmentExecutableKotlinJs FAILED
e: java.lang.NullPointerException
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrElementToJsExpressionTransformer.visitCall(IrElementToJsExpressionTransformer.kt:200)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrElementToJsExpressionTransformer.visitCall(IrElementToJsExpressionTransformer.kt:23)
        at org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl.accept(IrCallImpl.kt:47)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrElementToJsExpressionTransformer.visitTypeOperator(IrElementToJsExpressionTransformer.kt:242)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrElementToJsExpressionTransformer.visitTypeOperator(IrElementToJsExpressionTransformer.kt:23)
        at org.jetbrains.kotlin.ir.expressions.impl.IrTypeOperatorCallImpl.accept(IrTypeOperatorCallImpl.kt:40)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsAstUtilsKt.jsVar(jsAstUtils.kt:21)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrElementToJsStatementTransformer.visitVariable(IrElementToJsStatementTransformer.kt:97)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrElementToJsStatementTransformer.visitVariable(IrElementToJsStatementTransformer.kt:18)
        at org.jetbrains.kotlin.ir.declarations.impl.IrVariableImpl.accept(IrVariableImpl.kt:74)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrElementToJsStatementTransformer.visitBlockBody(IrElementToJsStatementTransformer.kt:28)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrElementToJsStatementTransformer.visitBlockBody(IrElementToJsStatementTransformer.kt:18)
        at org.jetbrains.kotlin.ir.expressions.IrBlockBody.accept(IrBody.kt:54)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsAstUtilsKt.translateFunction(jsAstUtils.kt:55)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrFunctionToJsTransformer.visitSimpleFunction(IrFunctionToJsTransformer.kt:22)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrFunctionToJsTransformer.visitSimpleFunction(IrFunctionToJsTransformer.kt:14)
        at org.jetbrains.kotlin.ir.declarations.IrSimpleFunction.accept(IrSimpleFunction.kt:29)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsClassGenerator.generateMemberFunction(JsClassGenerator.kt:155)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsClassGenerator.generate(JsClassGenerator.kt:82)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrDeclarationToJsTransformer.visitClass(IrDeclarationToJsTransformer.kt:28)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrDeclarationToJsTransformer.visitClass(IrDeclarationToJsTransformer.kt:12)
        at org.jetbrains.kotlin.ir.declarations.IrClass.accept(IrClass.kt:56)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrFileToJsTransformer.visitFile(IrFileToJsTransformer.kt:19)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrFileToJsTransformer.visitFile(IrFileToJsTransformer.kt:13)
        at org.jetbrains.kotlin.ir.declarations.impl.IrFileImpl.accept(IrFileImpl.kt:63)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrModuleToJsTransformer.generateModuleBody(IrModuleToJsTransformer.kt:255)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrModuleToJsTransformer.generateWrappedModuleBody2(IrModuleToJsTransformer.kt:148)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrModuleToJsTransformer.generateWrappedModuleBody(IrModuleToJsTransformer.kt:110)
        at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.IrModuleToJsTransformer.generateModule(IrModuleToJsTransformer.kt:61)
        at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compile(compiler.kt:128)
        at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compile$default(compiler.kt:38)
        at org.jetbrains.kotlin.cli.js.K2JsIrCompiler.doExecute(K2JsIrCompiler.kt:257)
        at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:181)
        at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:74)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:88)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
        at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1575)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
        at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
        at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)

here is my config:

plugins {
    kotlin("js")
}
group = "me.roman"
version = "1.0-SNAPSHOT"
kotlin {
    js {
        useCommonJs()
        binaries.executable()
        browser {
            webpackTask {
                cssSupport.enabled = true
            }
            runTask {
                cssSupport.enabled = true
            }
            testTask {
                useKarma {
                    useChromeHeadless()
                    webpackConfig.cssSupport.enabled = true
                }
            }
        }
    }
}

repositories {
    mavenCentral()
}

fun kotlinw(target: String): String =
    "org.jetbrains.kotlin-wrappers:kotlin-$target-pre.204-kotlin-1.5.0"

dependencies {
    implementation(npm("react-responsive", "8.2.0"))
    implementation(npm("react-virtuoso", "1.9.1"))
    implementation("com.ccfraser.muirwik:muirwik-components:0.8.2")

    implementation(project(":LonjeShared"))

    implementation(kotlinw("react:17.0.2"))
    implementation(kotlinw("react-dom:17.0.2"))
    implementation(kotlinw("react-router-dom:5.2.0"))
    implementation(kotlinw("react-redux:7.2.3"))
    implementation(kotlinw("styled:5.3.0"))

    implementation("org.jetbrains.kotlinx:kotlinx-html-js:0.7.3")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0")
}

gradle.properties

# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
#org.gradle.daemon=true
#org.gradle.configureondemand=true
org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kotlin.js.experimental.generateKotlinExternals=true
kotlin.js.compiler=ir
kotlin.mpp.stability.nowarn=true

kotlinVersion = 1.5.0
ktorVersion = 1.6.1
cfnz commented 3 years ago

Hi, not sure if I can help - not sure it is a problem with Muirwik. I have Muirwik working with the IR compiler in the test app and the starter app (and other noon replated apps) and don't have an issue.

As a side note, as mentioned elsewhere, I usually work with the Legacy compiler as it is much faster during development due to the incremental compiler ability.

A further side note, I have been looking at supporting 1.5.20... there are a few changes to the wrappers post pre.204 that required quite a few code changes. Have it working - will release this as version 0.9.0 soonish as there are some breaking changes (due to the wrappers changing).

theromis commented 3 years ago

@cfnz thank you for quick reply, probably will close the issue and will use legacy compiler, any way it works and I have a lot to do, already lost 2 days for upgrade with 0 results.