Cannot find type 'WidgetFamily' in scope

Using xcode 13.4 on MacOS with Monterey 12.4. while developing widget, compile error shows "Cannot find type 'WidgetFamily' in scope". Any solution?

You need to import WidgetKit.

If you haven't fixed this already, remove : WidgetFamily from that line. You don't need it.

Cannot find type 'WidgetFamily' in scope
 
 
Q