Prisma include becomes undefined when importing nested include objects across multiple files
Problem:
I'm working with Prisma and TypeScript and I have a set of nested include objects split across multiple files.
However, when I import and use them in a repository, some of the nested includes appear as undefined at runtime.
When I log the include objects, I get:
And Prisma only returns:
The nested
Expected behaviour:
Question:
Is this a known issue with Prisma + TypeScript module evaluation order? How can I reliably build nested include objects across multiple files without them becoming undefined? Any help or recommended pattern would be appreciated.
I'm working with Prisma and TypeScript and I have a set of nested include objects split across multiple files.
However, when I import and use them in a repository, some of the nested includes appear as undefined at runtime.
When I log the include objects, I get:
And Prisma only returns:
The nested
city -> department -> region relations are not loaded because the include was undefined.Expected behaviour:
ownerIndexInclude should contain all nested includes, and Prisma should hydrate the entire object tree.Question:
Is this a known issue with Prisma + TypeScript module evaluation order? How can I reliably build nested include objects across multiple files without them becoming undefined? Any help or recommended pattern would be appreciated.