Sagar Khurana
12/08/2025, 9:06 PMLazyVerticalStaggeredGrid + Paging3?
Crash: kotlin.NoSuchElementException in SortedSet.nonJvm.kt:98 - removeLast() called on empty list
Context:
- Crash happens 1-2 seconds after launch when scrolling a LazyVerticalStaggeredGrid
- Using Paging3 with collectAsLazyPagingItems()
- Crash is in framework code (compose-multiplatform-core), not app code
- Android works fine with identical code
Versions:
- Compose Multiplatform: 1.9.3
- Kotlin: 2.2.21
- Paging Compose: 3.4.0-alpha03
- Device: iPhone 16 Pro (iPhone18,3), iOS 18.1
Stack trace:
kotlin.NoSuchElementException
kfun:kotlin.collections#removeLast (MutableCollections.kt:257)
kfun:androidx.compose.ui.node.SortedSet#remove (SortedSet.nonJvm.kt:98)
kfun:androidx.compose.ui.node.DepthSortedSet#remove (DepthSortedSet.kt:78)
kfun:androidx.compose.ui.node.MeasureAndLayoutDelegate#onNodeDetached (MeasureAndLayoutDelegate.kt:755)
...
kfun:androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridState.onScroll (LazyStaggeredGridState.kt:312)
The crash flow: scroll gesture → onScroll → forceRemeasure() → subcompose() → LayoutNode.detach() → DepthSortedSet.remove() → SortedSet.remove() → removeLast() on empty list
I couldn't find an existing issue for this. Has anyone seen this or know of a workaround? Planning to file on YouTrack if this is new.Ivan Matkov
12/08/2025, 9:07 PMSagar Khurana
12/08/2025, 9:14 PMSagar Khurana
12/08/2025, 9:14 PMSagar Khurana
12/09/2025, 5:08 AMSagar Khurana
12/09/2025, 5:12 AM1.10.0-rc02 with the fix will drop?Sagar Khurana
12/09/2025, 5:13 AMEkaterina Zaitseva
12/09/2025, 8:54 AM1.10.0-rc02 ~ today/tomorrow, in an exceptional case - next weekSagar Khurana
12/09/2025, 8:56 AM1.10.0-rc02 next week in case of an exceptional case?
As it's blocking my v1 release for the Apple App Store and thanks for the responsive replies 🙏Ivan Matkov
12/09/2025, 9:00 AMIvan Matkov
12/09/2025, 9:02 AMmaven("<https://maven.pkg.jetbrains.space/public/p/compose/dev>")Sagar Khurana
12/09/2025, 9:03 AMEkaterina Zaitseva
12/09/2025, 1:15 PMSagar Khurana
12/09/2025, 1:16 PMSagar Khurana
12/09/2025, 1:35 PM