Unable to run drizzle query for supabase
I've tried npm, pnpm and bun to check if was something related to how modules are resolved.
Here is my
drizzle.ts
:
Getting this stack trace:
Below is my package json dependencies.
I searched online and found it was happenning for pg 8.11 and tried to manually set it to 8.10 like below and running pnpm up
but to no avail:
Any help is much appreciated.13 Replies
Hey @Servesh! Do you use Supabase Functions?
Not aware of those, first time using Supabase..
Here is screenshot from my supabase dashboard
when do you get your error? And I think you should use only
postgres
driver, so pg
driver can be deletedSo I'm creating a next js app with app router and I've created an api endpoint. On calling the endpoint from browser or thunder client I get the error
Try to use
neon
driver instead of postgres
driver
https://www.npmjs.com/package/@neondatabase/serverless
npm
@neondatabase/serverless
node-postgres for serverless environments from neon.tech. Latest version: 0.9.3, last published: 20 days ago. Start using @neondatabase/serverless in your project by running
npm i @neondatabase/serverless
. There are 17 other projects in the npm registry using @neondatabase/serverless.This totally worked. Thank u so much @Mykhailo . Wow, the config was hard. Can you please tell how did u know to use this driver
Super! This is due to runtime where you execute your code,
postgres-js
driver is not available in all runtimes. Do you use cloudflare workers or vercel edge functions?Not as I know of, just created a project in supabase and was playing with the setup. How can I check that?
Can u share me your github username so I can give u a shoutout
Seems like it is due to hono.js or next.js. I will investigate and return to you with more detailed explanation:)
github - realmikesolo
Yeah Next.js seems to be the cause. I missed the earlier reply to the supabase query of this discussion https://github.com/vercel/next.js/discussions/50177
GitHub
cloudflare plugin · vercel next.js · Discussion #50177
Summary Hi, I am a new developer trying to create a tool to visualize sql data tables, and to render and visualize the tables, I need a PostgreSQL URI so that i can connect to that database, but i ...
The reply I referred to uses
@vercel/postgres
. Do u know if anything that needs to be taken care of