In my case, swift package generate-xcodeproj and opening the .xcodeproj file instead of Package.swift made it possible to access the Xcode preview.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: