You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My connection was working fine previously without this statement neonConfig.poolQueryViaFetch = true; but I just applied once in my hono prisma file and after that db calls are not working in node app when I am using flag = driverAdapter
why is that happening when It was working fine without it previously.
this is my setup for next and node I have a different one for hono
import{PrismaClient}from"@prisma/client";import{PrismaNeon}from"@prisma/adapter-neon";import{neonConfig,Pool}from"@neondatabase/serverless";constprismaClientSingleton=()=>{constuseAdapter=process.env.USE_ADAPTER==="true";if(useAdapter){neonConfig.poolQueryViaFetch=true;constpool=newPool({connectionString: process.env.DATABASE_URL});constadapter=newPrismaNeon(pool);returnnewPrismaClient({ adapter }asnever);// log: process.env.NODE_ENV === "development" ? ["query", "error", "warn"] : ["error"],}returnnewPrismaClient();};typePrismaClientSingleton=ReturnType<typeofprismaClientSingleton>;declare global {varprismaGlobal: PrismaClientSingleton|undefined;}constdb=globalThis.prismaGlobal??prismaClientSingleton();// in order to avoid creating too many prisma instances in development.if(process.env.NODE_ENV!=="production"){globalThis.prismaGlobal=db;}exportdefaultdb;exporttype*asSchemaTypesfrom"@prisma/client";export{Prisma}from"@prisma/client";
In prod my USE_ADAPTER is false its for local development since hono requires me to use the adapter and next works fine without it, but if I enable driverAdapter for hono in local this produces errors for next which leads me to use it (adapter) for next and node in local development also.
Update: If I ran node app solely with this neonConfig.poolQueryViaFetch = true; then it completed db calls and return data but when I am running all 4 apps to test, it fails when nextjs sends a REST req to node app with the error.
EXPECTED:
Node app should work without producing any error
CURRENT:
currently getting this error
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: fetch failed
If you want to look at the repo its, but it doesn't contain latest changes here
The text was updated successfully, but these errors were encountered:
I am using :
My connection was working fine previously without this statement
neonConfig.poolQueryViaFetch = true;
but I just applied once in my hono prisma file and after that db calls are not working in node app when I am usingflag = driverAdapter
why is that happening when It was working fine without it previously.
this is my setup for next and node I have a different one for hono
In prod my
USE_ADAPTER
is false its for local development since hono requires me to use the adapter and next works fine without it, but if I enable driverAdapter for hono in local this produces errors for next which leads me to use it (adapter) for next and node in local development also.Update: If I ran node app solely with this
neonConfig.poolQueryViaFetch = true;
then it completed db calls and return data but when I am running all 4 apps to test, it fails when nextjs sends a REST req to node app with the error.EXPECTED:
Node app should work without producing any error
CURRENT:
currently getting this error
If you want to look at the repo its, but it doesn't contain latest changes here
The text was updated successfully, but these errors were encountered: