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
sevindusevindu 

No base file for markup LWC

User-added image

I am getting the above error when trying to push to scratch org. Can some one point out the error please?
Raj VakatiRaj Vakati
Looks like you are using the <c-learn> markup in the code .. please check once in web components 

 
Bao Nguyen 30Bao Nguyen 30
Hi guys,

I got the same error like that and later found out that all component files have to have the exact same name as the project folder. I got the error when SF requires the folder name to start with a lower case so I changed it without changing the component files' name. Give it a try to see if it helps.

Bao.
akochakoch
I've done as Bao suggested, and also tried deploying just the default lwc generated with the sfdx commands.  Also tested on my mac and windows machine.  Same problem.  I'm really stuck here.  Any other suggestions would be appreciated!
Rahul Kumar DeyRahul Kumar Dey
I got the same error while I'm try to deploy source code,, Can anyone have solution for it??
Arvind Thakur 24Arvind Thakur 24

We need to specify the -meta.xml file along with the LWC file else we would receive some error related to component not found

I had the same issue today, where I changed something in my HTML and tried to deploy just the HTML file. Figured it out eventually.

https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.create_components_meta_file

Please mark the question as resolved to help other.
Thanks!

LWC Deployment issue

vaibhav jadhav 35vaibhav jadhav 35
Try changing the name of the component.
 https://lwc.dev/guide/reference
Asmit__cAsmit__c
Hello Ohana,
I also found similar issue in my vs code.
Pls try this Solution: My components have same name as of the folder in which they are contained.

But It worked when I changed the VS CODE Project Folder Name as it had same name as of  component folder name ,then it got deployed easily.
for Ex: lwc_recipes(VS code folder name) ->forceapp->main->lwc->lwc_recipes(where lwc component resides with same name as of folder) ~for this error will occur

lwc_recipes_oss(VS code folder name) ->forceapp->main->lwc->lwc_recipes(where lwc component resides with same name as of folder) ~This pattern will work and the components will get deployed to the org.

Thanks,
Asmit
Linga_RaminLinga_Ramin
I faced the same error fought with it for few days and finally resolved now with your post here.
Thanks Asmit
Namaste
Ankit Aggarwal 100Ankit Aggarwal 100
It must be happening as you might have changed the component name. And it is also case sensitive. I have renamed the file and it resolved the issue.
Malika Pathak 9Malika Pathak 9

Hi Sevindu,

please find the solution 

I got the error when SF requires the folder name to start with a lower case so I changed it without changing the component files' name. Give it a try to see if it helps.
 
 you can change or delete this component 
 
 I am writing some steps to change the name of the component.
 Please follow these steps 
 
 >> sfdx force:project:create -n myComponent
 >>  cd myComponent
 >>  sfdx force:lightning:component:create -n myComponent --type=lwc -d force-app/main/default/lwc
 >>  sfdx force:org:create -f config\project-scratch-def.json --setalias myScratchOrg --setdefaultusername
>>  sfdx force:source:push

 

If you find this helpful mark it as the best answer.

Shyam VaishnavShyam Vaishnav
Hi Sevindu / Akoch / Rahul Kumar Dey,

Got the same error. Try closing the VS CODE window, open it, then deploy the LWC folder. Worked for me

Shyam
If you find this helpful mark it as the best answer.
Pratiksha Jadhav 30Pratiksha Jadhav 30
Hey @Shyam Vaishnav THANK-YOU so much, it worked for me too!!
Tarun STarun S
Just Rename the folder in which your component files are present to any name. Then again name it as it was before. It will work.

Tarun
If you find this helpful mark it as the best answer.
Padullaparthi NarayanaPadullaparthi Narayana
There is one more workaround , in VS code - explorer -Right click on component and deploy this will help in deploying the markup(xml) as well.
Please mark as best answer if this helps.
Thanks
User-added image
anil sutar 8anil sutar 8
such error appear when only js file deployed to server. Need to deploy whole component.
Gourav BhardwajGourav Bhardwaj
This issues happed with me when i create a new LWC Component from VSCode and was trying to deploy it to the org by right-clicking on any one of the files (.js, .HTML).
I was able get rid of this error by deploying the LWC folder instead of a single file.
 
MantoManto
Try 'Deploy this source' from metadata file, this worked for me