2

I'm creating a Flow Screen LWC component. In my .js-meta.xml file, I added a few properties. I loaded the component in the flow editor, and realized that I forgot to make the properties required. I removed my component and cancelled the edit, then I update the file and tried to deploy with SFDX. I get the error:

The property 'objectApiName' can’t be required without specifying a default value 
because the component is being referenced in these flow versions: ''

I understand that if a component already exists in a flow, you can't change a property to be required without also providing a default, in case that property isn't set in the existing flow where the component is used. However, I was careful to remove my component, and then cancel the flow edit entirely. No version of any flow has been saved with this component present in the flow. Even the error message, referenced in these flow versions: '', indicates a null flow version. How can I get the system to forget about my cancelled edit and let me save my changes? I don't want a default value on these properties; they need to be supplied by the config user.

1 Answer 1

7

Immediately after posting my question, I stumbled upon the solution. Or a solution. I simply deleted the offending properties from the .js-meta.xml file, and I was able to deploy my change. Then I added them back (literally undid my edit) and deployed again, and no issue.

5
  • 1
    Thanks mate, I had this exact some problem yesterday and was going to post a question here about it :)
    – Nick C
    Aug 26, 2021 at 2:09
  • I wasn't able to replicate this solution. I had removed a default value from my .js-meta.xml file, but was then unable to deploy it. Adding the default value back in, deploying, then removing and trying to deploy again did not resolve the error. I still get the null reference to a flow version in the failed deploy output.
    – Garywoo
    Oct 12, 2022 at 10:05
  • 1
    I just realised that you were suggesting to delete the entire <property> element, and not just removing the attribute from inside it. Doing this resolved the issue for me.
    – Garywoo
    Oct 12, 2022 at 10:29
  • Worked like a charm Oct 29, 2022 at 0:28
  • It worked like a charm, that saved me a few mins, it still sounds like a bug. Mar 7, 2023 at 18:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .