skip to Main Content

Reactjs – Im using next.js new app router and in the code bellow I get a TypeError: Cannot read properties of undefined (reading 'headers')

Updated code after some suggestions from comments(still getting the same error): const bcrypt = require("bcrypt") const User = require("../../model/userModel") export async function POST(req: NextRequest) { await dbConnect() const res = await req.json() await bcrypt.hash(res.passwd, 10) .then(async (hashedPassword: any) => {…

VIEW QUESTION
Back To Top
Search