Skip to content
Advertisement

API resolved without sending a response for /api/users/create, this may result in stalled requests. NEXTJS

I created an API endpoint to handle user account creation in my Next.js app, and I am using knex.js to handle my queries, but I still get this error:

JavaScript

My code in /pages/api/users/create.js:

JavaScript

Advertisement

Answer

actually the bcrypt hash function is an async function, it returns a promise to be either resolved with the encrypted data salt or rejected with an Error.

JavaScript
Advertisement