Best way to debug validation error encountered in admin? #188
-
I'm receiving a validation error for a non-existent field on a collection in the admin. My error states Collection
Stack Trace
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hey @ryanlanciaux I can't see anything wrong in what you've shared. Is it possible you had an email field previously and have not saved changes or restarted the server? Using Here are some other thoughts:
payload.init( {
// [...]
onInit: (app) => {
console.log(app.collections.locations.Model.schema.tree);
payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`);
},
}); If the schema does not have it and yet the validation still expects email, I have no answer and will have to do some more digging. |
Beta Was this translation helpful? Give feedback.
Hey @ryanlanciaux I can't see anything wrong in what you've shared. Is it possible you had an email field previously and have not saved changes or restarted the server? Using
yarn dev
should pick up on changes as it usesnodemon
, though I have seen instances where file changes are missed for some reason, stop it and restart if you haven't already.Here are some other thoughts:
api/locations
route and not something else likeapi/users
?