Using an ORM to access your Postgres dat...
I"m using vercel/postgres + NEON
I get this error whenever I try running a query:
"details": "All attempts to open a WebSocket to connect to the database failed. Please refer to https://github.com/neondatabase/serverless/blob/main/CONFIG.md#websocketconstructor-typeof-websocket--undefined. Details: ws does not work in the browser. Browser clients must use the native WebSocket object",
Any ideas? I'm able to get this working with
import { NeonHTTPDialect } from 'kysely-neon'
But I was hoping to see if the vercel setup would work...
I was following these docs: https://vercel.com/docs/storage/vercel-postgres/using-an-orm#kysely
Using an ORM to access your Postgres database
Learn how to use your favorite ORM to access your database from your apps
GitHub
serverless/CONFIG.md at main · neondatabase/serverless
Connect to Neon PostgreSQL from serverless/worker/edge functions - neondatabase/serverless
1 Reply
ratty-blush•8mo ago
Hi, which driver are you using? Which environment are you trying to run queries via WebSocket?
My guess is the environment you're using does not support WebSocket and that's why HTTP works for your use case.