[SalesForce] Lightning Web Component – Not able to reference content asset file in LWC js

I uploaded an image in asset library and imported that using below code in my LWC js file

import PLACEHOLDER_IMAGE from '@salesforce/contentAssetUrl/placeholderImage'; 
export default class CpFeatures extends LightningElement {
    // Expose the asset file URL for use in the template
    placeholderImage = PLACEHOLDER_IMAGE;

When I am pushing the code to the org I am getting

Exception while getting the content asset for reference
placeholderImage of type contentAssetUrl in file

Best Answer

I ran into the same issue. To fix it I added the contentassets to my vscode project, and then the deployment went through.

Related Topic