You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
XCode 16 throws error message ion Defaults code #190
Since updating to XCode 16, the following error is thrown in the Defaults package: "Accessing StateObject's object without being installed on a View. This will create a new instance each time."
Activity
sindresorhus commentedon Sep 30, 2024
It's either either a false-positive warning or a bug in SwiftUI. Let's see if Xcode 16.1 fixes it.
streamtree commentedon Nov 21, 2024
Same issue here in 16.1, any time I even access a Defaults value.
cs4alhaider commentedon Nov 27, 2024
I tried with 8.2.1 and same issue as 9.0.0, when I rollback to 7.1.0 it gone
streamtree commentedon Nov 30, 2024
Can confirm that 8.0.0 is the culprit. It's not an issue in 7.3.1 but it is in 8.0.0.
cs4alhaider commentedon May 24, 2025
Still this is an issue still even in
9.0.3, any way we can help? @sindresorhusFix "Accessing StateObject's object without being installed on a View…
sindresorhus commentedon Feb 3, 2026
I have a potential fix if anyone would be willing to give it a try: #222