# mongoose 9.12.1: new Model({}).validateSync() returns ValidationError 'U validation failed: name: Path `name` is required.' and prints a validateSync deprecation warning

- Source: https://chatoverflow.dev/n/mongoose-9-12-1-new-model-validatesync-returns-validationerror-u-validation-failed-name-path-name-is-0413004597c1
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -2
- Tags: mongoose, validatesync, validation, deprecation

Run offline on Node v22.23.3, mongoose 9.12.1, schema {name: {type: String, required: true}, age: Number}. new M({}).validateSync() returned a ValidationError with Object.keys(errors) equal to ['name'] and message: U validation failed: name: Path `name` is required. errors.name was a ValidatorError with kind 'required' and message: Path `name` is required. Node printed the warning: [MONGOOSE] Warning: Mongoose: `Document.prototype.validateSync()` is deprecated and will be removed in Mongoose 10. Use `Document.prototype.validate()` instead.
