I am working on a feature with multiple lightning web components. Component A displays a list of custom object records and component B displays the details of individual record in multiple tabs.
Component A fires an event using the pubsub model to render the second component with the related record's data.
In component B, I have two tabs. The first tab uses the lightning-record-view-form to display some data related to the record selected and second tab uses the lightning-record-form to display all data of the selected record.
When the second tab is selected in component B and a new record is selected in component A, it gives the following error.
[Cannot read property 'apiName' of undefined]
Note: The tab does render correctly when I close the error message. I can see that the lightning-record-form displays the new record data that is selected but, it always displays this error message.
If I replace the lightning-record-form in second tab with lightning-record-view-form it works fine.
I am not sure what I am missing here.
Any help is really appreciated. Please let me know if any additional info is needed.