I am currently in the process of verifying if a user's email already exists. To achieve this, I am utilizing Prisma Client's findUnique
method. Below is the code snippet I have implemented:
const userWithEmail = await prisma.user.findUnique({
where: {
email,
},
});
However, I encountered a TypeScript error:
No value exists in scope for the shorthand property 'email'. Either declare one or provide an initializer.ts(18004)
Here is my schema.prisma
file:
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
...
And here is my route.ts
file:
import { PrismaClient } from "@prisma/client";
import { NextResponse } from "next/server";
import validator from "validator";
...
I am working with Next.js 13 and Prisma. Can someone please help me identify what I might be doing incorrectly?