<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Error loading assets when the app loads for the first time in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-loading-assets-when-the-app-loads-for-the/m-p/1332819#M82330</link>
    <description>&lt;P&gt;I have a Vue application that utilizes ArcGIS JS SDK 4.26.&lt;/P&gt;&lt;P&gt;Within this application, I have a FeatureLayer with a UniqueValueRenderer, which is defined as follows:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;	const layer = new FeatureLayer({
		title: 'Some title',
		fields: [...],
		...
		...
		renderer: new UniqueValueRenderer({
			field: 'rate',
			uniqueValueInfos: [
				new UniqueValueInfo({
					value: '1',
					symbol: new PictureMarkerSymbol({
						width: 20,
						height: 20,
						url: './assets/images/img-1.svg'
					})
				}),
				new UniqueValueInfo({
					value: '2',
					symbol: new PictureMarkerSymbol({
						width: 20,
						height: 20,
						url: './assets/images/img-2.svg'
					})
				})
			]
		})
	})&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The application is deployed to a specific path, let's call it "&lt;A href="http://www.example.com/sub-path/" target="_blank"&gt;www.example.com/sub-path/&lt;/A&gt;."&lt;/P&gt;&lt;P&gt;I've encountered an unusual behavior with the map. When the application is initially loaded, particularly after clearing the cache, the map attempts to retrieve assets from "&lt;A href="http://www.example.com/assets/images/img-1.svg" target="_blank"&gt;www.example.com/assets/images/img-1.svg&lt;/A&gt;," resulting in 404 errors.&lt;/P&gt;&lt;P&gt;Strangely, this issue does not persist during subsequent page loads unless the cache is cleared again. After the initial load, the requests are correctly directed to "&lt;A href="http://www.example.com/sub-path/assets/images/img-1.svg" target="_blank"&gt;www.example.com/sub-path/assets/images/img-1.svg&lt;/A&gt;."&lt;/P&gt;&lt;P&gt;Can anyone shed light on this behavior and provide guidance on how to address it?&lt;/P&gt;</description>
    <pubDate>Wed, 27 Sep 2023 08:07:22 GMT</pubDate>
    <dc:creator>ElhamAmin</dc:creator>
    <dc:date>2023-09-27T08:07:22Z</dc:date>
    <item>
      <title>Error loading assets when the app loads for the first time</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-loading-assets-when-the-app-loads-for-the/m-p/1332819#M82330</link>
      <description>&lt;P&gt;I have a Vue application that utilizes ArcGIS JS SDK 4.26.&lt;/P&gt;&lt;P&gt;Within this application, I have a FeatureLayer with a UniqueValueRenderer, which is defined as follows:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;	const layer = new FeatureLayer({
		title: 'Some title',
		fields: [...],
		...
		...
		renderer: new UniqueValueRenderer({
			field: 'rate',
			uniqueValueInfos: [
				new UniqueValueInfo({
					value: '1',
					symbol: new PictureMarkerSymbol({
						width: 20,
						height: 20,
						url: './assets/images/img-1.svg'
					})
				}),
				new UniqueValueInfo({
					value: '2',
					symbol: new PictureMarkerSymbol({
						width: 20,
						height: 20,
						url: './assets/images/img-2.svg'
					})
				})
			]
		})
	})&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The application is deployed to a specific path, let's call it "&lt;A href="http://www.example.com/sub-path/" target="_blank"&gt;www.example.com/sub-path/&lt;/A&gt;."&lt;/P&gt;&lt;P&gt;I've encountered an unusual behavior with the map. When the application is initially loaded, particularly after clearing the cache, the map attempts to retrieve assets from "&lt;A href="http://www.example.com/assets/images/img-1.svg" target="_blank"&gt;www.example.com/assets/images/img-1.svg&lt;/A&gt;," resulting in 404 errors.&lt;/P&gt;&lt;P&gt;Strangely, this issue does not persist during subsequent page loads unless the cache is cleared again. After the initial load, the requests are correctly directed to "&lt;A href="http://www.example.com/sub-path/assets/images/img-1.svg" target="_blank"&gt;www.example.com/sub-path/assets/images/img-1.svg&lt;/A&gt;."&lt;/P&gt;&lt;P&gt;Can anyone shed light on this behavior and provide guidance on how to address it?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 08:07:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-loading-assets-when-the-app-loads-for-the/m-p/1332819#M82330</guid>
      <dc:creator>ElhamAmin</dc:creator>
      <dc:date>2023-09-27T08:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Error loading assets when the app loads for the first time</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-loading-assets-when-the-app-loads-for-the/m-p/1332985#M82338</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/721933"&gt;@ElhamAmin&lt;/a&gt;&amp;nbsp; This sounds like a Vue.js configuration issue and not related to ArcGIS JS SDK functionality. Vue.js can have some weird caching issues. You might checkout the Vue.js documentation such as this page: &lt;A href="https://vitejs.dev/guide/assets.html," target="_blank"&gt;https://vitejs.dev/guide/assets.html,&lt;/A&gt; or do some related internet searches.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 16:15:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-loading-assets-when-the-app-loads-for-the/m-p/1332985#M82338</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2023-09-27T16:15:44Z</dc:date>
    </item>
  </channel>
</rss>

