3

I created a package that contains some account customizings such as record types and custom fields for accounts, flows, custom objects and a couple of rest endpoints to expose functionality.

I can perfectly push/pull the package content with force:source:push and force:source:pull.

However, when I run the force:package:version:create command, the process aborts with Cannot read property '0' of undefined..

1 Answer 1

0

I'm posting the solution here, so anyone with the same error message may find it helpful.

In my case, the error was produced by a force:source:pull command, after I deactivated the flow version. In the flowDefinitions folder the process definition for the deactivated lightning process got synced to the following shape:

<?xml version="1.0" encoding="UTF-8"?>
<FlowDefinition xmlns="http://soap.sforce.com/2006/04/metadata"/>

the correct content has to look something like this:

<?xml version="1.0" encoding="UTF-8"?>
<FlowDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
    <activeVersionNumber>1</activeVersionNumber>
</FlowDefinition>

where 1 is a available revision in flows for the related process definition.

1
  • 1
    Worth mentioning also that as of CLI version 44.0, the flow definitions as well as flow versions have been made redundant. In order for sfdx builds to succeed with version 44, flowDefinitions folder should be completely emptied, with all flow versions in the flows folder deleted, apart from the active one which should be renamed so it's stripped of the trailing version number (as per the Winter 19 release notes). releasenotes.docs.salesforce.com/en-us/winter19/release-notes/…
    – dino ursic
    Oct 22, 2018 at 11:15

You must log in to answer this question.

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