This past weekend, our org was updated to Spring '20 and since our use of recordId and the getRecord method broke. The recordId is undefined when the getRecord method is wired and won't run again even if the recordId variable is set/updated. Is anyone else having this issue? Is there a way to workaround this or force the getRecord wire to re-run?
I've also tried using refreshApex, getting the pageReference and setting the recordId variable, etc.
EDIT:
Added MRC for example. This component was placed directly on the Case page with an Account related to it.
import { LightningElement, api, wire } from 'lwc';
import { getRecord } from 'lightning/uiRecordApi';
export default class TestGetRecord extends LightningElement {
@api recordId;
@wire(getRecord, {
recordId: "$recordId",
fields: [],
optionalFields: ["Case.Account.Name"]
})
wiredRecord({ error, data }) {
console.log("recordId: ", this.recordId);
if (data) {
console.log("Data: ", data);
} else if (error) {
console.log("Error: ", error);
} else {
console.log("Both undefined.");
}
}
}
The metadata is setting 'isExposed' to true and has a target of 'lightning__RecordPage'.
EDIT2:
Adding a screenshot of the component on the record page. Only visibility settings are shown.