subRows.map is not a function

I am getting a subRows.map is not a function error when adding the "with" parameter to my relational queries.

here is my schema;

export const users = pgTable("users", {
  id: serial("id").primaryKey(),

  name: text("name"),
  role: text("role").default("user"),
});

export const usersRelations = relations(users, ({ many }) => ({
  parties: many(parties),
}));

export const parties = pgTable("parties", {
  id: serial("id").primaryKey(),
  partyName: text("party_name"),
  authorId: integer("author_id"),
});

export const postsRelations = relations(parties, ({ one }) => ({
  author: one(users, {
    fields: [parties.authorId],
    references: [users.id],
  }),
}));
Was this page helpful?