function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Umar Farooq 50Umar Farooq 50 

Getting Error unexpected token: a floating point number

Getting following error for the code :

                                <img src="{!$ContentAsset.03S1w0000004Z6l}" alt="TLogo" class="tlogo"/> 

Error:
Failed to save xxxxxx.cmp: unexpected token: a floating point number at column 14 of expression: $ContentAsset.03S1w0000004Z6l: Source
ravi soniravi soni

Hi Umar,
I think you are trying to load  img from static resource.try following way.
In Lightning Aura Component
 <img src="{!$Resource.yourStaticResourceName}" alt="test"/>

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
And If you want to load img in Lwc than try following way.
In html
 <img src={resource} alt="test"/>
In Js
import yourStaticResourceName from '@salesforce/resourceUrl/yourStaticResourceName';
export default class yourClassName extends LightningElement {

   resource=yourStaticResourceName ;
}

let me know if it's helps you and marking it as best. so that it could help to others.
Thank you

Chris GroverChris Grover
Did you ever find a resolution to this?  I am working with a community on my dev box after a refresh from prod.  Looks like assets were stored in a zip file and I tried updating the asset id in the code to point to the zip file in my dev org but im getting the same error.  Tried with 15 character and 18 character ids but it still does not work.