1

I have created LWC for showing accounts and created one Lighting web component and one apex class shown below. Html file

   <template>
    <lightning-card title="Showing Account(tile)">
        <template if:true={successResponse}>
            <template for:each={accounts} for:item="account">
                <li key={account.id}>
                    <div class="slds-p-around_medium lgc-bg">
                        <lightning-tile label={account.Name} href="/path/to/somewhere">
                            <p class="slds-truncate" title={account.Phone}>Account's Phone Number is : 

{account.Phone}
                            </p>
                        </lightning-tile>
                    </div>
                </li>
            </template>
        </template>
    </lightning-card>
</template>

Js.file

import { LightningElement, wire, track } from "lwc";
import allAccount from "@salesforce/apex/AcountManager.getAccount"

export default class AccountManagerApex extends LightningElement {

  @wire(allAccount)
  accountRecrd;

  successResponse (){
    if(this.accountRecrd){
      return true;
    }
    return false;
  }

}

and Class is:

public with sharing class AcountManager {

    @AuraEnabled( cacheable = true) 
    public static List<Account> getAccount(){

        return [SELECT Id,Name,Phone,Website FROM Account Limit 10];
    }
}

When I try to deploy to my org using VSCode I'm getting the below error.

Error

force-app\main\default\lwc\accountManagerApex\accountManagerApex.js No MODULE named markup://lgc:bg found : [markup://c:accountManagerApex]

Can anyone tell me how to fix this issue/

Thanks in advance,

Tech Skill
  • 25
  • 1
  • 7

2 Answers2

2

You have a custom css class lgc-bg. Please make sure your css file has a period before the selector

/* incorrect, lwc tries to find lgc:bg component */
lgc-bg : {}
/* correct */
.lgc-bg {}
1

Try setting <isExposed>true</isExposed> inside meta.xml file of the component

Sidd
  • 84
  • 1
  • 2
  • 7