Reply to How to solve "Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:)) on model updates." error? URLSession.shared.dataTaskPublisher(for: urlRequest).tryMap { // your httpHandlerData } .receive(on: RunLoop.main) .eraseToAnyPublisher()Just add .receive(on: RunLoop.main) operator before .eraseToAnyPublisher() and That's it. UI Frameworks SwiftUI Apr ’20