I got the error to go away by changing the .onAppear modifier to .task on a SwiftUI view observing a published property.
Below the navigation title modifier of the view.
.navigationTitle("Where you're at")
.task {
// Fetch data from CloudKit here
viewModel.fetchData()
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: