I have a Swift Package Manager module with some SwiftUI files that I was using Previews without issues in Xcode 15.2. When I upgraded to Xcode 15.3, it fails with “Cannot preview in this file. Unexpected error occurred”. When I click to get more info, this is the error:
== PREVIEW UPDATE ERROR:
HumanReadableSwiftError
BuildError: failedToGenerateThunkInfo(could not generate preview info: noTargetBuildGraph)
Is anyone experiencing the same problems? My preview, which lives in a SPM package, works totally fine in Xcode 15.2, but fails in Xcode 15.3. Any ideas for how to fix it? I've tried deleting DerivedData, resetting package caches, clean building. So frustrating seeing these regression issues popping up still.
I filed FB13678356 but it was quickly marked as "Investigation Complete - Unable to diagnose with current information" but there was no request for what further information I could provide! I attached a full sysdiagnose and error log!
Would also note, that when I revert back to Xcode 15.2, the previews go back to working...
Updated the Feedback with a small example and was able to find a fix! It looks like the error is happening because of a library I use that uses macros. I eventually found a warning in the project logs and had to accept the above message after which it started working again.
Would note, not having enabled that macros plugin caused every preview in every package to stop working without any clear error message as to why! So glad I was able to get things working again though. Shoutout the guys at http://pointfree.co for taking a look!