@Cabearsfan seems to be correct, but the thing is if you are trying to test multiple widgets, this when you gonna start pull your hair, so I found this article by apple - https://developer.apple.com/documentation/widgetkit/debugging-widgets they mention Cabearsfan solution, but what I have tried that they didn't really mention how, I duplicated all of the three environment variables, and assigned in the _XCWidgetkind the string that is located in Widget struct for the variable kind, and the rest changed to the size of the preview you gonna run or what you have for the family. so if you have 3 widgets you might need to have like 3 duplicates of those environment assigning the detail per each. I am not sure if that will always work but for me that was the only way that I got rid of the error for now.