2

I have been following the documentation for excluding file types from the sfdx force:source:push command at https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm

It works fine for apex classes, custom objects, etc.

When given a directory structure like:

./force-app/main/default/aura/SearchResult
├── SearchResult.cmp
├── SearchResult.cmp-meta.xml
├── SearchResult.css
├── SearchResult.src.js
├── SearchResultController.js
└── SearchResultHelper.js

and a .forceignore file in the root directory like:

**/SearchResult.src.js

it fails:

> sfdx force:source:push
PROJECT PATH  ERROR
────────────  ───────
              Unknown

Upon further investigation, it seems that after I make an update to any file in that bundle, the force:source:push actually converts the source to the metadata API format + zip file with a package.xml that looks like:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
  <types>
    <name>AuraDefinitionBundle</name>
    <members>SearchResult</members>
  </types>
  <version>41.0</version>
</Package>

This does not maintain any of the information provided by the .forceignore file. Doing more investigation found the following error (which was masked by the Unknown stated above):

UNKNOWN_EXCEPTION: Unable to handle Aura Definition \'SearchResult/SearchResult.src.js\': file extension expected'

Is there any way to achieve the ability to include files alongside within an AuraDefinitionBundle? The goal is to have an asset pipeline (like gulp) that converts things written in ES6, SASS, and writes the salesforce-compliant JS/CSS files before pushing to a scratch org. Given the current implementation, I can't figure out a way to do this without storing these source files in a different directory.

Any help would be greatly appreciated

  • I get the same weird error. This is the only other post I've found that has it too. Did you ever make any progress ? – SallyRothroat Jan 12 '18 at 20:58
  • Since sfdx treats aura bundles as singular assets, I haven't found a way to do this natively. That being said, I have developed a hacky way of deleting + re-adding of individual files that do not satisfy the bundle requirements before pushing with the CLI. It's not ideal, but until more flexibility is provided with the aura bundle, I don't think there is any other way – Andrew Turgeon Jan 13 '18 at 21:16
1

Thanks for bringing this to our attention. I've created a bug for our team. We are working on a Known Issue for this and I will post that once it is ready. Unfortunately there isn't much of a workaround except to remove the files from the aura bundle directory. As you mentioned, you can try storing the files that shouldn't be pushed in a separate directory that is .forceignored or in a different project path altogether.

  • I started getting that error in summer 18 very often, did You found a solution for that already or any workaround? – patryk Jun 25 '18 at 5:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.