TypeError: Cannot read properties of undefined (reading 'fieldtype')

Hopefully this might help someone else. I was getting the obscure error below when loading the Sales Invoice in desk, which wasn’t loading fully. Did a bit of debugging and found it was related to the Hospitality domain, Restaurant module which wasn’t active.

Turns out I had enabled the domain, copied Sales Invoice into DocType Layout, then disabled the domain with a lot of time in-between. So Sales Invoice was looking for DocFields that didn’t exist any more.

TypeError: Cannot read properties of undefined (reading ‘fieldtype’)
at setup_add_fetch (form.min.js?ver=1666977797.0:1:1151122)
at Object. (form.min.js?ver=1666977797.0:1:1151313)
at Function.each (jquery.min.js:2:2861)
at init.setup (form.min.js?ver=1666977797.0:1:1151278)
at frappe.ui.form.Form.setup (form.min.js?ver=1666977797.0:1:1200888)
at frappe.ui.form.Form.refresh (form.min.js?ver=1666977797.0:1:1204860)
at frappe.views.FormFactory.render (form.min.js?ver=1666977797.0:1:1108289)
at form.min.js?ver=1666977797.0:1:1107967
at Object.callback (desk.min.js?ver=1666977797.0:1:167326)
at Object.success [as success_callback] (desk.min.js?ver=1666977797.0:1:64131)

1 Like