Effect CommunityEC
Effect Community3y ago
72 replies
Stephen Bluck

Resolving Cycle Dependencies with Schema

How is everyone resolving cycle dependencies with Schema?
TypeError: Cannot read properties of undefined (reading 'ast')
 ❯ Module.record node_modules/.pnpm/@effect+schema@0.21.0/node_modules/@effect/src/Schema.ts:783:40
 ❯ app/lib/gizmoClient/models/Card.ts:149:34
    147| 
    148| export type AddCardResponse = S.To<typeof AddCardRe…
    149| export const AddCardResponse = S.struct({
       |                                  ^
    150|   card_id: S.optionFromNullable(S.number),
    151|   deck_id: S.optionFromNullable(S.number),
 ❯ app/lib/gizmoClient/models/Deck.ts:2:31
 ❯ app/core/decks/DecksLive.ts:4:31

This is killing me. It only happens in my tests and I can't see any cycle dependencies anywhere. The error also doesn't point me to anywhere useful.
Was this page helpful?