I have some SwiftUI code and it seems to work great when I build to a real iOS device or to an iOS simulator.
However in the SwiftUI canvas the preview says Failed
So I had this same issue except it couldn't find my own module... For me the problem was because I have custom build configurations and it didn't like the custom module name. The solution was to rename the module to the same as debug and release in Build Settings > Product Module Name
I hope this helps someone