simo
simo
PPrisma
Created by simo on 10/8/2024 in #help-and-questions
TypeError: Cannot read properties of undefined (reading 'exec')
Yes, the error persists. I'll share a repo with you this afternoon. Thanks
17 replies
PPrisma
Created by simo on 10/8/2024 in #help-and-questions
TypeError: Cannot read properties of undefined (reading 'exec')
I have cleared the npm cache and reinstalled node.js
17 replies
PPrisma
Created by simo on 10/8/2024 in #help-and-questions
TypeError: Cannot read properties of undefined (reading 'exec')
I still have the same error
17 replies
PPrisma
Created by simo on 10/8/2024 in #help-and-questions
TypeError: Cannot read properties of undefined (reading 'exec')
Sorry, I don't have access to the code right now, but when I can, I'll attach all the possible parts of the code.
17 replies
PPrisma
Created by simo on 10/8/2024 in #help-and-questions
TypeError: Cannot read properties of undefined (reading 'exec')
No, it is not deployed to edge
17 replies
PPrisma
Created by simo on 10/8/2024 in #help-and-questions
TypeError: Cannot read properties of undefined (reading 'exec')
What version of openssl do you recommend?
17 replies
PPrisma
Created by simo on 10/8/2024 in #help-and-questions
TypeError: Cannot read properties of undefined (reading 'exec')
Or maybe I have openSSL configured wrong
17 replies
PPrisma
Created by simo on 10/8/2024 in #help-and-questions
TypeError: Cannot read properties of undefined (reading 'exec')
Thank you very much for your help. I have made the suggested changes and I still have the same error. I suspect that it may be something wrong with the version of openSSL I have installed on my Windows OS.
17 replies
PPrisma
Created by simo on 10/8/2024 in #help-and-questions
TypeError: Cannot read properties of undefined (reading 'exec')
// prisma/schema.prisma


generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters"]
binaryTargets = ["native"]
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}

//client.ts

import ws from "ws"
import { Pool, neonConfig } from "@neondatabase/serverless"
import { PrismaNeon } from "@prisma/adapter-neon"
import { PrismaClient } from "@prisma/client"

const prismaClientSingleton = () => {
neonConfig.webSocketConstructor = ws
neonConfig.poolQueryViaFetch = true
const pool = new Pool({ connectionString: `${process.env.DATABASE_URL}` })
const adapter = new PrismaNeon(pool)
const db = new PrismaClient({ adapter })

return db
}

declare const globalThis: {
prismaGlobal: ReturnType<typeof prismaClientSingleton>
} & typeof global
const db = globalThis.prismaGlobal ?? prismaClientSingleton()
export default db
if (process.env.NODE_ENV !== "production") globalThis.prismaGlobal = db
// prisma/schema.prisma


generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters"]
binaryTargets = ["native"]
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}

//client.ts

import ws from "ws"
import { Pool, neonConfig } from "@neondatabase/serverless"
import { PrismaNeon } from "@prisma/adapter-neon"
import { PrismaClient } from "@prisma/client"

const prismaClientSingleton = () => {
neonConfig.webSocketConstructor = ws
neonConfig.poolQueryViaFetch = true
const pool = new Pool({ connectionString: `${process.env.DATABASE_URL}` })
const adapter = new PrismaNeon(pool)
const db = new PrismaClient({ adapter })

return db
}

declare const globalThis: {
prismaGlobal: ReturnType<typeof prismaClientSingleton>
} & typeof global
const db = globalThis.prismaGlobal ?? prismaClientSingleton()
export default db
if (process.env.NODE_ENV !== "production") globalThis.prismaGlobal = db
17 replies