cashapp/multiplatform-paging

Js browser target: Function 'collectAsLazyPagingItems' can not be called: No function found for symbol...

Closed this issue · 2 comments

Describe the bug
Browser target has issue with collectAsLazyPagingItems function. Desktop, Android and OS targets works well. Browser target worked well a few month ago.

Affected platforms: Browser

Versions:

  • multiplatform-paging: 3.3.0-alpha02-0.4.0
  • Kotlin: 1.9.22
  • Compose compiler: 1.5.8
  • Compose Multiplatform: 1.6.0-dev1369
  • JDK (for desktop issues): 17

To Reproduce
Open GitHub page https://siarhei-luskanau.github.io/pixabayeye/
Or

  1. Checkout the https://github.com/siarhei-luskanau/pixabayeye
  2. Launch browser target using Gradle task :composeApp:jsBrowserDevelopmentRun
  3. Browser should be opened with browser target. You can see the next error in the browser developer console:
X_: Function 'collectAsLazyPagingItems' can not be called: No function found for symbol 'app.cash.paging.compose/collectAsLazyPagingItems|collectAsLazyPagingItems@kotlinx.coroutines.flow.Flow<androidx.paging.PagingData<0:0>>(androidx.compose.runtime.Composer?;kotlin.Int){0§<kotlin.Any>}[0]' CoroutineExceptionHandlerImpl.kt:11:12
    va CoroutineExceptionHandlerImpl.kt:11
    Wo CoroutineExceptionHandlerImpl.common.kt:52
    ie CoroutineExceptionHandler.kt:32
    <anonymous> Builders.common.kt:194
    Ve JobSupport.kt:231
    is JobSupport.kt:910
    is JobSupport.kt:867
    <anonymous> JobSupport.kt:832
    <anonymous> AbstractCoroutine.kt:100
    <anonymous> Continuation.kt:54
    <anonymous> composeApp.js:1
    <anonymous> CoroutineContext.kt:60
    <anonymous> AbstractCoroutine.kt:102
    <anonymous> Continuation.kt:54
    <anonymous> composeApp.js:1
    <anonymous> Scopes.kt:32
    <anonymous> AbstractCoroutine.kt:102
    <anonymous> Continuation.kt:54
    <anonymous> composeApp.js:1
    <anonymous> Continuation.kt:54
    qC FlushCoroutineDispatcher.skiko.kt:62
    SC Synchronized.kt:24
    <anonymous> FlushCoroutineDispatcher.skiko.kt:57
    <anonymous> composeApp.js:1
    r composeApp.js:1
    <anonymous> IntrinsicsJs.kt:163
    <anonymous> Standard.kt:55
    <anonymous> composeApp.js:1
    <anonymous> Continuation.kt:45
    <anonymous> JSDispatcher.kt:131
    <anonymous> JSDispatcher.kt:59

Expected behavior
working Pagination on Browser target like Desktop, Android and OS targets

This is because in JetBrains Compose 1.6 they removed the usage of JS decoys in the Compose compiler. It will require a recompilation of every Compose-based project that targets JS. We had to wait for 1.6 stable to update ours. This came out today, so we're working on it.

Thank you very much! Issue was solved with multiplatform-paging="3.3.0-alpha02-0.5.1" and jetbrains-compose="1.6.0"

Versions:
multiplatform-paging: 3.3.0-alpha02-0.5.1
Kotlin: 1.9.22
Compose compiler: 1.5.10
Compose Multiplatform: 1.6.0
JDK (for desktop issues): 17