Relations with Drizzle ORM and Supabase

I'm having this Next.js project where I would like to query a user
with
their permissions using Drizzle ORM and Supabase. I keep getting the following error when I try to add with into the query as documented here: https://orm.drizzle.team/docs/rqb.

Error message:

Error: Cannot read properties of undefined (reading 'referencedTable')

I have already the question up at Stackoverflow since this would not allow me to share the code as it is too long.

Link to thread:
https://stackoverflow.com/questions/77780541/how-to-declare-and-query-with-relations-using-drizzle

I hope you can see what I do wrong. Your help is much appreciated 🙏
Stack Overflow
I'm having this Next.js project where I would like to query a user with their permissions using Drizzle ORM and Supabase. I keep getting the following error when I try to add with into the query as
Was this page helpful?