function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jonathon Hiley 4Jonathon Hiley 4 

Can't push components to organization using salesforce cli

I was working through the 'Lightning Web Components Basics' trailhead unit and was successfully able to push the E-bikes demo app and components to my organization. As per the trailhead instructions, I was using the salesforce CLI command:
sfdx force:source:deploy -p force-app -u <username>

This worked initially, but after making the prescribed changes to some web components for the unit, the deploy command now fails with the error: 
The component must implement at least one of lightning__AppPage interface.
Even if I checkout the e-bike demo app code clean from GitHub, it still fails with the same error.
Is there something wrong with my CLI configuration? Or organization configuration?
 
Raj VakatiRaj Vakati
Can you try fo do an force override ??

sfdx force:source:deploy  --forceoverwrite -p force-app -u <username>
Jonathon Hiley 4Jonathon Hiley 4
Is the --forceoverwrite option only available in certain versions of the CLI? It produced an error when I tried using it:
ERROR running force:source:deploy:  Unexpected argument: --forceoverwrite

I have version sfdx-cli/7.3.0-94ecf2d5ee win32-x64 node-v10.15.3
pankaj.ds.sharmapankaj.ds.sharma
Jonathan, i faced the same issue for Selector component when trying to deploy the changes. It seems to be defect in SF deployment of web components.
As a resolution i removed the(selector) component from the lightning app page. Saved the lightning app page.
Again deployed the same component through command and it got deployed successfully. Added the component back on the lightning app page & ran the app page.
sfdx force:source:deploy -p force-app/main/default/lwc/selector -u <username>
SForceBeWithYouSForceBeWithYou

Make sure you check your errors in all the files of the LWC.

For me, it was just having a duplicate variable declared during a refactor...
 

@wire(getRecord, { recordId: '$recordId', fields: [OPP_ISWON_FIELD]})
loadOppResult({ error, data }) {
    let data = result.data;
    let error = result.error;

Error on push/deploy was "Error  force-app/main/default/lwc/myLwc/myLwc.js  bad result: { TypeError: Cannot read property 'buildError' of undefined    at Scope.checkBlockScopedCollisions (/home/sfdc/tools/lwc/1.1.13-224.8/node_modules/@lwc-platform/sfdc-lwc-compiler/node_modules/@babel/traverse/lib/scope/index.js:347:22)    at Scope.registerBinding (/home/sfdc/tools/lwc/1.1.13-224.8/node_modules/@lwc-platform/sfdc-lwc-compiler/node_modules/@babel/traverse/lib/scope/index.js:504:16)    at Scope.registerDeclaration (/home/sfdc/tools/lwc/1.1.13-224.8/node_modules/@lwc-platform/sfdc-lwc-compiler/node_modules/@babel/traverse/lib/scope/index.js:444:14)    at Object.BlockScoped (/home/sfdc/tools/lwc/1.1.13-224.8/node_modules/@lwc-platform/sfdc-lwc-compiler/node_modules/@babel/traverse/lib/scope/index.js:189:28)    at Obje"

Super helpful error message. :-)