Drizzle cannot run directly in loader/action
So I have been in the process of switching over from prisma to drizzle and I have hit a huge roadblock. Right now the only way that I can run queries is in server files.
Every-time I try to run drizzle queries directly in loaders or actions it prevents the page from loading. The only way I can get it to work is to move the queries into server files and then import it into the route that I am using it in.
Following the chain of issues down the call stack I end up in an aws-sdk file with the error code "No Providers in Chain"
1 Reply
A little bit more context is that I am using drizzle and remix in a turbo repo. I have attempted to load drizzle in a server file by doing the following
I figured out that tables cannot be used directly. I had to pull in the database module from another turborepo package. And I needed to pull the table definitions through a ‘.server.ts’ file before using in a routes loader