Search code examples
salesforcesalesforce-lightninglwc

No MODULE named markup://lgc:bg found : [markup://c:accountManagerApex]


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,


Solution

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