Next.js recently became the official React framework as outlined in React docs. In this course, you'll learn the most important Next.js concepts and how they fit into the React ecosystem. Finally, you'll put your skills to the test by building a modern full-stack Next 14 application.
This is the error I am getting whenever I click the create button with a prompt and a tag.
page.jsx:24
POST http://localhost:3000/api/prompt/new 500 (Internal Server Error)
MongoDB Connected
Error creating prompt: Error: Prompt validation failed: tag: Tag is required
at ValidationError.inspect (C:\Users\ASUS\Desktop\next-js\share-prompts\node_modules\mongoose\lib\error\validation.js:50:26)
at formatValue (node:internal/util/inspect:805:19)
at inspect (node:internal/util/inspect:364:10)
at formatWithOptionsInternal (node:internal/util/inspect:2279:40)
at formatWithOptions (node:internal/util/inspect:2141:10)
at console.value (node:internal/console/constructor:352:14)
at console.warn (node:internal/console/constructor:385:61)
at POST (webpack-internal:///(rsc)/./app/api/prompt/new/route.js:23:17)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async C:\Users\ASUS\Desktop\next-js\share-prompts\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:63251 {
errors: {
tag: ValidatorError: Tag is required
at SchemaType.doValidate (C:\Users\ASUS\Desktop\next-js\share-prompts\node_modules\mongoose\lib\schemaType.js:1349:7)
at C:\Users\ASUS\Desktop\next-js\share-prompts\node_modules\mongoose\lib\document.js:2972:18
at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
properties: [Object],
kind: 'required',
path: 'tag',
value: undefined,
reason: undefined,
[Symbol(mongoose#validatorError)]: true }
},
_message: 'Prompt validation failed'
}
This is the error I am getting whenever I click the create button with a prompt and a tag.
page.jsx:24