Retrieving LWC causes import of metadata to be __c - fails when (re)deploying #1288
Labels
area:lwc
Highlights the lwc functional area of the CLI.
owned by another team
The Salesforce CLI team does not own this work but will pass on the information to the correct team.
Summary
Having an LWC importing fields from a metadata type; when retrieving this metadata type becomes __c instead of __mdt, making the file undeployable.
Steps To Reproduce:
Having:
import FALC_MDT_MASTER_LABEL_FIELD from '@salesforce/schema/FinancialAccountListColumn__mdt.MasterLabel';
Steps:
sfdx force:source:deploy --loglevel fatal -m LightningComponentBundle:financialAccountList2
sfdx force:source:retrieve --loglevel fatal -m LightningComponentBundle:financialAccountList2
import FALC_MDT_MASTER_LABEL_FIELD from '@salesforce/schema/FinancialAccountListColumn__c.MasterLabel';
sfdx force:source:deploy --loglevel fatal -m LightningComponentBundle:financialAccountList2
Error financialAccountList2 Invalid reference FinancialAccountListColumn__c.MasterLabel of type sobjectClass in file financialAccountList2.js
Expected result
Should be able to deploy just retrieved LWC :-).
I.e. metadata type should have postfix __mdt instead of __c.
Actual result
Fails:
Error financialAccountList2 Invalid reference FinancialAccountListColumn__c.MasterLabel of type sobjectClass in file financialAccountList2.js
System Information
sfdx-cli/7.125.0 win32-x64 node-v16.13.0
(also fails for version 126 (on mac os))
(Also fails from VS Code)
Additional information
The text was updated successfully, but these errors were encountered: