Cannot conform to 'ObservableObject';Key path value type '_' cannot be converted to contextual type '_'

import SwiftUI

struct ContentView: View { @StateObject private var vm = PetsListViewModel

init(){
    _vm = StateObject(wrappedValue: PetsListViewModel(service: Webservice()))
}

var body: some View {
    NavigationView {
        ScrollView {
            ForEach(vm.components, id:\.uniqueId
            ){ component in component.render()
            }
            
            .navigationTitle("Pets")
        }.task {
            await vm.load()
        }
    }
}

}

Without more context or explanations, it's hard to help you.

Cannot conform to 'ObservableObject';Key path value type '_' cannot be converted to contextual type '_'
 
 
Q