Drizzle error on netlify edge functions

Hi there. I am experiencing problems when I try to do insert or update to database via drizzle on netlify edge functions specifically. I know it sounds odd but the website is working perfectly when deployed on vercel.

I would get an error of cannot read properties of undefined (reading from) when i do a simple statement such as db.insert(profiles).values(data).returning(); However, if I write raw sql queries it works. So again, the insert() and update() fails on netlify functions specifically (not select() though, I know, it’s weird).

I am using Qwik with netlify edge adapter. It could be the problem on the Qwik/Drizzle side but I am really clueless right now so any hints as to why to this is happening will be greatly appreciated.

I will try to make a minimal reproducible sample when I get the time. My drizzle-orm package is v0.29.1.

Let us know when you have the reproduction sample, without which this is not possible to check.