Created
December 5, 2022 03:06
-
-
Save ManotLuijiu/64297966c1e54f3b67a8b573d18e454e to your computer and use it in GitHub Desktop.
Error from mongoose when model had been edited
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error - Error: Service validation failed: brand: Path `brand` is required., price: Path `price` is required., image: Path `image` is required. | |
at ValidationError.inspect (/Users/manotlj/Project/AodProject/NextJS-Ecommerce/acc-service-app/node_modules/mongoose/lib/error/validation.js:50:26) | |
at formatValue (node:internal/util/inspect:806:19) | |
at inspect (node:internal/util/inspect:365:10) | |
at formatWithOptionsInternal (node:internal/util/inspect:2273:40) | |
at formatWithOptions (node:internal/util/inspect:2135:10) | |
at console.value (node:internal/console/constructor:349:14) | |
at console.warn (node:internal/console/constructor:382:61) | |
at Object.error (/Users/manotlj/Project/AodProject/NextJS-Ecommerce/acc-service-app/node_modules/next/dist/build/output/log.js:33:13) | |
at DevServer.logErrorWithOriginalStack (/Users/manotlj/Project/AodProject/NextJS-Ecommerce/acc-service-app/node_modules/next/dist/server/dev/next-dev-server.js:805:21) { | |
errors: { | |
brand: ValidatorError: Path `brand` is required. | |
at validate (/Users/manotlj/Project/AodProject/NextJS-Ecommerce/acc-service-app/node_modules/mongoose/lib/schematype.js:1346:13) | |
at SchemaType.doValidate (/Users/manotlj/Project/AodProject/NextJS-Ecommerce/acc-service-app/node_modules/mongoose/lib/schematype.js:1330:7) | |
at /Users/manotlj/Project/AodProject/NextJS-Ecommerce/acc-service-app/node_modules/mongoose/lib/document.js:2903:18 | |
at process.processTicksAndRejections (node:internal/process/task_queues:77:11) { | |
properties: [Object], | |
kind: 'required', | |
path: 'brand', | |
value: undefined, | |
reason: undefined, | |
[Symbol(mongoose:validatorError)]: true | |
}, | |
price: ValidatorError: Path `price` is required. | |
at validate (/Users/manotlj/Project/AodProject/NextJS-Ecommerce/acc-service-app/node_modules/mongoose/lib/schematype.js:1346:13) | |
at SchemaType.doValidate (/Users/manotlj/Project/AodProject/NextJS-Ecommerce/acc-service-app/node_modules/mongoose/lib/schematype.js:1330:7) | |
at /Users/manotlj/Project/AodProject/NextJS-Ecommerce/acc-service-app/node_modules/mongoose/lib/document.js:2903:18 | |
at process.processTicksAndRejections (node:internal/process/task_queues:77:11) { | |
properties: [Object], | |
kind: 'required', | |
path: 'price', | |
value: undefined, | |
reason: undefined, | |
[Symbol(mongoose:validatorError)]: true | |
}, | |
image: ValidatorError: Path `image` is required. | |
at validate (/Users/manotlj/Project/AodProject/NextJS-Ecommerce/acc-service-app/node_modules/mongoose/lib/schematype.js:1346:13) | |
at SchemaType.doValidate (/Users/manotlj/Project/AodProject/NextJS-Ecommerce/acc-service-app/node_modules/mongoose/lib/schematype.js:1330:7) | |
at /Users/manotlj/Project/AodProject/NextJS-Ecommerce/acc-service-app/node_modules/mongoose/lib/document.js:2903:18 | |
at process.processTicksAndRejections (node:internal/process/task_queues:77:11) { | |
properties: [Object], | |
kind: 'required', | |
path: 'image', | |
value: '', | |
reason: undefined, | |
[Symbol(mongoose:validatorError)]: true | |
} | |
}, | |
_message: 'Service validation failed', | |
page: '/api/seed' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solution: restart the dev server
nextjs: npm run dev