I'm trying to create a share css style rule for my lwc components following the doc and it doesn't work

I created a LWC component like this



:host() {
   --my-color: red; 


<?xml version="1.0" encoding="UTF-8" ?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">

But when I tried to deploy this, I see this error

Error force-app/main/default/lwc/myStyle/myStyle.js-meta.xml No base file for markup://c:myStyle

And it deletes my files!!!

I added the Javascript and HTML files and when I tried to import the css module in another component I get this error: Unknown ref type slds for ref c/myStyle in file..

The doc also it's not very clear. What is the difference between the lwc component described in step 1 and the component in step 2?


  • Did you find a solution to this ?
    – Shamina
    Jul 29, 2020 at 14:30

1 Answer 1


The problem was fixed in newer versions. After Summer ’20 is working

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.