The problem was that there was a custom struct with the name Context, which conflicted with the Context type required by UIViewControllerRepresentable methods. Changing the structure name solved the problem.