this is my first time using mongodb, I am trying to code a simple and basice code that stores the input of the user, but I faced an error that I did not what exactly is causing it, this is the github link for the project: https://github.com/Kiritsu0/Mongodb-Nextjs
I tried asking chatgpt but it didn’t know how to solve the error. I write a console.log on the beginning of the route file component, but it is not logged to the console which means the problem is created on the home page where the handleSubmit function. This is the errors that are returned on the console:
POST http://localhost:3000/api/user 500 (Internal Server Error) page.js:16
page.js:36 Error1: SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON