Smileyface
Smileyface
Explore posts from servers
PPrisma
Created by Smileyface on 7/15/2024 in #help-and-questions
Initial find query giving weird error
Hey guys, for some reason every time I try to register, I get this error:
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) {
And all it points to is this:
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 }
});
}
3 replies