Initial find query giving weird error
Hey guys, for some reason every time I try to register, I get this error:
And all it points to is this:
Invalid `db.user.findUnique()` invocation
1 const db = require('./prisma');
2
3 const findUserByEmail = async (email) => {
→ 4 return await db.user.findUnique(
Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "42P05", message: "prepared statement \"s1\" already exists", severity: "ERROR", detail: None, column: None, hint: None }), transient: false })
at async Object.findUserByEmail (C:\Personal\TravelExperts\src\repositories\userRepository.js:4:13)
at async Object.register (C:\Personal\TravelExperts\src\services\userService.js:7:27)
at async register (C:\Personal\TravelExperts\src\controller\authController.js:21:13) {
Invalid `db.user.findUnique()` invocation
1 const db = require('./prisma');
2
3 const findUserByEmail = async (email) => {
→ 4 return await db.user.findUnique(
Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "42P05", message: "prepared statement \"s1\" already exists", severity: "ERROR", detail: None, column: None, hint: None }), transient: false })
at async Object.findUserByEmail (C:\Personal\TravelExperts\src\repositories\userRepository.js:4:13)
at async Object.register (C:\Personal\TravelExperts\src\services\userService.js:7:27)
at async register (C:\Personal\TravelExperts\src\controller\authController.js:21:13) {
const findUserByEmail = async (email) => {
return await db.user.findUnique({
where: { email: email },
omit: { password: true }
});
}
const findUserByEmail = async (email) => {
return await db.user.findUnique({
where: { email: email },
omit: { password: true }
});
}
1 Reply
Which database are you using? Are you using any connection pooler?