SwiftUI crash on OSX 26 using NSColorPanel

I have an app that crashes on OSX 26 only. I have a @StateObject which is an observer of the NSColorPanel.

When I call

let panel = NSColorPanel.shared

in init(), SwiftUI will crash - apparently with an update while view is being updated. See crash log.

I was able to work around it by adding

let _ = NSColorPanel.shared

in my AppDelegate before SwiftUI is initialized.

The exact code worked fine in all previous OSX versions.

SwiftUI crash on OSX 26 using NSColorPanel
 
 
Q