4

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

2
  • This might be a simple question, but was the content asset uploaded to the same place you are deploying?
    – Kevin Hill
    May 8 '19 at 15:37
  • Yes, it was added to the same community's content assets.
    – Saloni
    Feb 19 '20 at 18:35
2

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

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.