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
    Commented May 8, 2019 at 15:37
  • Yes, it was added to the same community's content assets.
    – Saloni
    Commented Feb 19, 2020 at 18:35

1 Answer 1

3

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

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .