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
DTDrizzle Team
Created by Smileyface on 3/20/2024 in #help
User exists when no users are in database
No description
2 replies
DTDrizzle Team
Created by Smileyface on 3/20/2024 in #help
Property does not exist
No description
3 replies
DTDrizzle Team
Created by Smileyface on 3/11/2024 in #help
Property notNull does not exist on type 'PgEnum<[google, github]>
No description
6 replies