badoo / MVIKotlin

Extendable MVI framework for Kotlin Multiplatform with powerful debugging tools (logging and time travel), inspired by Badoo MVICore library
https://arkivanov.github.io/MVIKotlin
Apache License 2.0
828 stars 64 forks source link

MVI Kotlin (JS) is compatible/tested with which coroutines version? #195

Closed Shabinder closed 3 years ago

Shabinder commented 3 years ago

I just did setup for my project for JS-Browser target and I am getting following issue: image

image

Issue seems like a coroutines bug to me.... So I tried with with 2 different version 1.4.3 and 1.4.2 , but no luck . So to just confirm , MVI Kotlin + Decompose has to be proven working with which coroutines version?

for a reproducer , @arkivanov ,you are added as a collaborator in my project's private repo. image

arkivanov commented 3 years ago

@Shabinder Seems like the invitation has expired. Could you please try once again?

Shabinder commented 3 years ago

@Shabinder Seems like the invitation has expired. Could you please try once again?

sure, 1 second

Shabinder commented 3 years ago

@arkivanov New Invitation sent.

arkivanov commented 3 years ago

As of coroutines version, the mvikotlin-extensions-coroutines module is the only module that depends on coroutines, the version is1.4.2.

Shabinder commented 3 years ago

As of coroutines version, the mvikotlin-extensions-coroutines module is the only module that depends on coroutines, the version is1.4.2.

yup tried on 1.4.2 , still same error

arkivanov commented 3 years ago

I can't find the code in the relevant project, could you please point me on the exact location?

arkivanov commented 3 years ago

Sorry I was confused by the code snippet, just realised it is the MVIKotlin's code. I will check.

arkivanov commented 3 years ago

@Shabinder Could you please provide steps to reproduce?

Shabinder commented 3 years ago

@Shabinder Could you please provide steps to reproduce?

just launch , ./gradlew :web-app:browserDevelopmentRun --continuous

after building , brower will open ,and you can navigate through the stacktrace in console.

Shabinder commented 3 years ago

I believe the bug could be maybe related to this code too,I am not sure tho... web-app/src/main/kotlin/extras/RenderableComponent.kt: LINE 22

Edit: I also get error when I try launching anything in Global Scope too! you can try uncommenting line to see more errors related to this at following position: common/dependency-injection/src/commonMain/kotlin/com/shabinder/common/di/providers/SpotifyProvider.kt : Line 44

arkivanov commented 3 years ago

@Shabinder The issue seems indeed in Coroutines or Kotlin/JS. I tried using MVIKotlin 2.0.1 with mvikotlin-extensions-coroutines module in Decompose Counter JS app (in shared module), it works just fine. So it looks like something specific in your project causes the error. I can't do anything at this point, unfortunately. I recommend you to do the following:

  1. Report the error to Kotlin YouTrack. They accept private projects confidentially, or you can extract some minimal reproducer.
  2. Try to reduce your code to find the real cause (I usually doing something like binary search, commenting different parts of the code).

Let's keep this issue open for a while.

Shabinder commented 3 years ago

@arkivanov hey , I found the cause , but I dont Understand .....

if i override a flow variable in class Body like below , all works fine! image

but if I override it in constructor instead like below, it again throws error that .collect{} is not a function image

what is basically the change?, I don't Understand the real cause here....??? 🤔🤔🤔

arkivanov commented 3 years ago

@Shabinder this indeed looks like a compiler bug and worth reporting it to Kotlin YouTrack!

Shabinder commented 3 years ago

@Shabinder this indeed looks like a compiler bug and worth reporting it to Kotlin YouTrack!

yup, I did https://youtrack.jetbrains.com/issue/KT-45363

arkivanov commented 3 years ago

Thank you very much @Shabinder for investigating and reporting the issue!