Skip to content
Discussion options

You must be logged in to vote

Added code to the TCA CaseStudies and got a different error that confirms I am an old fool:

Cannot find 'Trips' in scope

Back in my project I had the FetchKeyRequest structure in State

    @Fetch(Trips(), animation: .default) var trips = Trips.Value()
    struct Trips: FetchKeyRequest {
    ...

so the solution was to add State to the load():

    try await state.$trips.load(State.Trips(), animation: .default)

and it builds and works correctly.

So why the quirky error diagnostic? Guessing that the Swift compiler was confused by my TCA feature is also Trips:

@Reducer
struct Trips {

Sorry to bother you, I guess I'll treat myself to the new episode that just dropped.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@sillygoose
Comment options

Answer selected by sillygoose
@mbrandonw
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants