Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created Aura Components aren't deployable #46

Open
achimraible opened this issue Nov 5, 2020 · 10 comments
Open

Created Aura Components aren't deployable #46

achimraible opened this issue Nov 5, 2020 · 10 comments

Comments

@achimraible
Copy link

Hi,

when one ore more Lightning Components (metadata type AuraDefinitionBundle) are part of the diff between two branches, the MDAPI deployment, which is based on the metadata created by the sfdx-git-packager, fails with the following error

Main markup cannot be empty. If you are trying to delete the Lightning definition bundle, directly delete the bundle instead.
Unable to build Aura Definition source for c:auraAPIName: We couldn't validate your component. Review it and try again. The following code has invalid references which caused save validation failure. aura.impl.db.packaging.LightningComponentPackagingServiceImpl@17d62fcf

Regards
Achim

@ChuckJonas
Copy link
Collaborator

Can you compare the Lightning Component in your feature branch to that of the component in the generated package and see what's missing?

We don't typically do LWC dev so there might need to be small adjustments.

@achimraible
Copy link
Author

Hi,

that's not about Lightning Web Components. I'm talking as mentioned before, about AuraDefinitionBundle (Lightning Component Bundle missed Bundle before) https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_lightningcomponentbundle.htm

@ChuckJonas
Copy link
Collaborator

Oh sorry... Can you still compare them to see what is different?

@ChuckJonas ChuckJonas changed the title Created Lightning Components aren't deployable Created Aura Components aren't deployable Nov 6, 2020
@achimraible
Copy link
Author

achimraible commented Nov 9, 2020

Hi,

I checked the metadata and there is only one file created named AuraAPIname.cmp-meta.xml. There should be as well files named like this

  • AuraAPIname.cmp
  • AuraAPIname.css
  • AuraAPInameController.js
  • AuraAPInameRenderer.js

Regards

@ChuckJonas
Copy link
Collaborator

Weird, I'll have to try to reproduce. Couple other things.

Can you tell me the version of SFDX cli you are using?

sfdx --version

Also if you still are able to reproducible, you can provide me with the output of

git --no-pager diff --name-status your-target-branch your-feature

@achimraible
Copy link
Author

Hi

sfdx version is
sfdx-cli/7.78.1-5a65d9dd2f win32-x64 node-v12.18.3

A question about the second command. What is meant for 'your-feature'? The Aura component?

@ChuckJonas
Copy link
Collaborator

ChuckJonas commented Nov 12, 2020

the feature branch... so something like

git --no-pager diff --name-status master my-branch1

Particularly I'm only interested in which files had changed around the Aura Component.

@achimraible
Copy link
Author

Hi,

I have to use two commits, but in sum it should be the same

$ git --no-pager diff --name-status c0039dade0aff45d4bfe407084b9eca6f6e29308 84123d2f3f09de4391d2414fbb2807340b6993b3
M .gitlab-ci.yml
M .packageIgnore
M build.xml
M destructiveChangesPost.xml
A force-app/main/default/aura/navigateToRecord/navigateToRecord.cmp
A force-app/main/default/aura/navigateToRecord/navigateToRecord.cmp-meta.xml
A force-app/main/default/aura/navigateToRecord/navigateToRecord.design
A force-app/main/default/aura/navigateToRecord/navigateToRecordController.js
M force-app/main/default/classes/TestDataFactory.cls
M force-app/main/default/classes/UnitCheckService.cls
M force-app/main/default/classes/UnitCheckServiceTest.cls
A force-app/main/default/labels/CustomLabels.labels-meta.xml
A force-app/main/default/layouts/Opportunity-Opportunity Layout.layout-meta.xml
A force-app/main/default/objects/Opportunity/fields/HP_Wert__c.field-meta.xml
A force-app/main/default/objects/Opportunity/fields/Loss_Reason__c.field-meta.xml
A force-app/main/default/objects/Opportunity/fields/Reason__c.field-meta.xml
A force-app/main/default/objects/Opportunity/validationRules/Loss_Reason_Required.validationRule-meta.xml
M force-app/main/default/permissionsets/DG_Integration.permissionset-meta.xml
M force-app/main/default/permissionsets/DG_Read_Only.permissionset-meta.xml
A force-app/main/default/standardValueSets/OpportunityStage.standardValueSet-meta.xml
M force-app/main/default/staticresources/UC_CitiesResource.txt
M force-app/main/default/staticresources/UC_HousesResource.txt
M force-app/main/default/staticresources/UC_StreetsResource.txt
M package.xml
A translations/objectTranslations/Lead-de.objectTranslation
A translations/objectTranslations/Opportunity-de.objectTranslation
A translations/objectTranslations/Product2-de.objectTranslation
A translations/package.xml
A translations/packageRetrieve.xml
A translations/standardValueSetTranslations/LeadStatus-de.standardValueSetTranslation
A translations/translations/de.translation

@achimraible
Copy link
Author

Hi,

perhabs I have a idea to solve this. If there any files (one or more) changed within the aura component folder, you always have to take all files from the component into the deployment. Only if all files are available, the aura component is deployable.
Regards
Achim

@ChuckJonas
Copy link
Collaborator

@achimraible that's actually exactly how it SHOULD be working.

https://github.com/callawaycloud/sfdx-git-packager/blob/master/src/metadataResolvers.ts#L71

The IsDirectory: ()=> true tells the packager it needs to "resolve" the entire directory...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants