I recently cloned a SwiftUI codebase from Git, but when I clicked on a SwiftUI view file, I was unable to preview it. I'm not sure if this is my problem or not so I created a new SwiftUI project and pasted in the same code, and the preview tab worked fine. So if anyone ever faced the same problem before. Please let me know how you fixed your problem. Problem Diagnostics message