I had the same problem and fixed it by making the enum Codable. I'm wondering if anyone knows why an enum has to conform to codable in SwiftData when it doesn't when using structs. Also, this error message was completely unhelpful in locating the issue, is this the kind of thing Apple wants feedback about?