Previews crash after making change to Swift Package version

Previews seemed to be working okay.

However, I wanted to test out some changes inside of a package that I'm working on for work, but in a lighter project since in our main project (where I have the package pulled in locally for now) is just too big to have the previews render in a decent amount of time.

So, I opened a small project that was already importing that package and was set to 'Up to Next Major', but I switched that to 'branch' and added my branch. This is the second time I've done that and it causes Xcode to freak out in terms of the previews. This is the code I have:

import SwiftUI

extension EnvironmentValues {
	@Entry var trailingDescriptionColorToken: Color = .secondary
}

extension View {
	func updateTrailingDescriptionColor(to colorToken: Color, when trigger: Bool) -> some View {
		environment(\.trailingDescriptionColorToken, trigger ? colorToken : .secondary)
	}
}

// MARK: - ListItemDescription

public struct ListItemDescription: View {
	@Environment(\.trailingDescriptionColorToken) var trailingDescriptionColorToken

	let description: String

	init(_ description: String) {
		self.description = description
	}

	public var body: some View {
		Text(description)
			.font(.caption)
			.foregroundStyle(trailingDescriptionColorToken)
	}
}

struct ContentView: View {
	@State private var isError = false

    var body: some View {
		VStack {
			Button("Error Trigger") { isError.toggle() }
			ListItemDescription("Description")
				.updateTrailingDescriptionColor(to: .red, when: isError)
		}
        .padding()
    }
}

#Preview {
    ContentView()
}

As soon as I tap the button to toggle the isError state property, that causes the preview canvas to indefinitely load and spin eventually leading to a crash.

This is infuriating as I've just wasted a ton of time at work trying to figure out what's going on.

Xcode and SPM is so fragile and delicate that at this point I feel like if I breathe on it wrong it'll break.

I'm not sure what fixed it last time. Nothing in Xcode makes sense anymore. How to I resolve this please?

Previews crash after making change to Swift Package version
 
 
Q