<?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 Re: [esri.core.workers] Failed to create Worker. JSON Parse failing on 'applicationURL' in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-core-workers-failed-to-create-worker-json/m-p/1355759#M82987</link>
    <description>&lt;P&gt;I have this same issue. It does not correctly parse the = character because if I replace the value with %3d in the URL it will work fine. Has anyone looked into this issue? Does esriConfig require the full URL in applicationURL or can it take the URL before the querystring?&lt;/P&gt;</description>
    <pubDate>Fri, 01 Dec 2023 16:38:39 GMT</pubDate>
    <dc:creator>René_Ténière</dc:creator>
    <dc:date>2023-12-01T16:38:39Z</dc:date>
    <item>
      <title>[esri.core.workers] Failed to create Worker. JSON Parse failing on 'applicationURL'</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-core-workers-failed-to-create-worker-json/m-p/1228562#M79244</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Trying to initialize&amp;nbsp;a map and map view, works fine in a sample project (localhost:4200/). But when using it with real environment URL (&lt;A href="http://localhost:4201/portal/dashboard?elementPath=\\\\ThisIsAServer\\SomeString\\Name\\Site\\HJSU&amp;amp;query=1552" target="_blank" rel="noopener"&gt;http://localhost:4200/portal/dashboard?elementPath=\\ThisIsAServer\SomeString\Name\Site\HJSU&amp;amp;query=1552&lt;/A&gt;), the workers fail to create with error;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Uncaught SyntaxError: Bad escaped character in JSON at position 97', filename: 'blob:http://localhost:4201/c708361e-0008-48a9-95b9-c955556554e8'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have debugged this error to being the applicationURL in the config JSON that the worker tries to parse which has a single and double \ in the (original) URL. The config is trying to escape the \ which results in '\\\\' and '\\' respectively, but as this is JSON inside JS, it requires 8 slashed instead of 4 to parse. See the attached fiddle with the current code and the working code.&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;A href="https://jsfiddle.net/CiegeNZ/7qt3gs8m/3/" target="_blank" rel="noopener"&gt;JSON parse on URL example - JSFiddle - Code Playground&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Question is how to fix this as I can't edit the worker code? and cannot parse the applicationURL through with my own escaping?&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;@arcgis/core - Latest (4.24)&amp;nbsp;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Angular 13.2&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Nov 2022 22:35:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-core-workers-failed-to-create-worker-json/m-p/1228562#M79244</guid>
      <dc:creator>ConnerFarrant</dc:creator>
      <dc:date>2022-11-03T22:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: [esri.core.workers] Failed to create Worker. JSON Parse failing on 'applicationURL'</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-core-workers-failed-to-create-worker-json/m-p/1230180#M79279</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/633600"&gt;@ConnerFarrant&lt;/a&gt;&amp;nbsp; are you building a custom ArcGIS JS API app or using an ArcGIS Dashboard? If you are using a Dashboard, you'll need to follow that product's System Requirements and Tech Support procedures. Here's a link to the &lt;A href="https://community.esri.com/t5/arcgis-dashboards-questions/bd-p/arcgis-dashboards-questions" target="_self"&gt;ArcGIS Dashboard community&lt;/A&gt; site if you need to reach out to them for more guidance.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 20:09:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-core-workers-failed-to-create-worker-json/m-p/1230180#M79279</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2022-11-09T20:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: [esri.core.workers] Failed to create Worker. JSON Parse failing on 'applicationURL'</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-core-workers-failed-to-create-worker-json/m-p/1230184#M79280</link>
      <description>&lt;P&gt;This is a JS App, simply trying to display a map on the page and dynamically pass through the lat, long etc. This issue is caused by the URL string.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 20:15:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-core-workers-failed-to-create-worker-json/m-p/1230184#M79280</guid>
      <dc:creator>ConnerFarrant</dc:creator>
      <dc:date>2022-11-09T20:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: [esri.core.workers] Failed to create Worker. JSON Parse failing on 'applicationURL'</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-core-workers-failed-to-create-worker-json/m-p/1230213#M79281</link>
      <description>&lt;P&gt;If it's a custom JS app we will need a link to a simple github repo, codesandbox or stackblitz.com sample. If you need a basic Angular + ArcGIS JS API sample as a starting point, we recommend using this one: &lt;A href="https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-angular-cli" target="_blank"&gt;https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-angular-cli&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 21:12:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-core-workers-failed-to-create-worker-json/m-p/1230213#M79281</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2022-11-09T21:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: [esri.core.workers] Failed to create Worker. JSON Parse failing on 'applicationURL'</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-core-workers-failed-to-create-worker-json/m-p/1355759#M82987</link>
      <description>&lt;P&gt;I have this same issue. It does not correctly parse the = character because if I replace the value with %3d in the URL it will work fine. Has anyone looked into this issue? Does esriConfig require the full URL in applicationURL or can it take the URL before the querystring?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 16:38:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-core-workers-failed-to-create-worker-json/m-p/1355759#M82987</guid>
      <dc:creator>René_Ténière</dc:creator>
      <dc:date>2023-12-01T16:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: [esri.core.workers] Failed to create Worker. JSON Parse failing on 'applicationURL'</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-core-workers-failed-to-create-worker-json/m-p/1355775#M82988</link>
      <description>&lt;P&gt;Here are more details with exception code attached:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Ren_Tnire_0-1701446021386.png" style="width: 726px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/87758i1561A09ABB61B20F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Ren_Tnire_0-1701446021386.png" alt="Ren_Tnire_0-1701446021386.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 16:47:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-core-workers-failed-to-create-worker-json/m-p/1355775#M82988</guid>
      <dc:creator>René_Ténière</dc:creator>
      <dc:date>2023-12-01T16:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: [esri.core.workers] Failed to create Worker. JSON Parse failing on 'applicationURL'</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-core-workers-failed-to-create-worker-json/m-p/1355817#M82990</link>
      <description>&lt;P&gt;I narrowed it down to JSON.parse() not liking the double backslash \\.&lt;/P&gt;&lt;P&gt;When the user opens a url:&amp;nbsp;&lt;A href="http://localhost:5173/?locale=fr&amp;amp;config=assets\config\config.json" target="_blank" rel="noopener"&gt;http://localhost:5173/?locale=fr&amp;amp;config=assets\config\config.json&lt;/A&gt;&amp;nbsp;what gets input into the&amp;nbsp;applicationURL of esriConfig is &lt;A href="http://localhost:5173/?locale=fr&amp;amp;config=assets\config\config.json" target="_blank" rel="noopener"&gt;http://localhost:5173/?locale=fr&amp;amp;config=assets\\config\\config.json&lt;/A&gt;. My workaround is to use the following url:&amp;nbsp;&lt;A href="http://localhost:5173/?locale=fr&amp;amp;config=assets%5cconfig%5cconfig.json" target="_blank" rel="noopener"&gt;http://localhost:5173/?locale=fr&amp;amp;config=assets%5cconfig%5cconfig.json&lt;/A&gt;&amp;nbsp;however, it is less user-readable and depends on user validation.&lt;/P&gt;&lt;P&gt;Is it possible for you to modify your code to encodeURI(&lt;SPAN&gt;window&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;location&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;href&lt;/SPAN&gt;) as the value you put into applicationURL so this exception will not happen in most case-scenarios?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 17:58:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-core-workers-failed-to-create-worker-json/m-p/1355817#M82990</guid>
      <dc:creator>René_Ténière</dc:creator>
      <dc:date>2023-12-01T17:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: [esri.core.workers] Failed to create Worker. JSON Parse failing on 'applicationURL'</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-core-workers-failed-to-create-worker-json/m-p/1356151#M82996</link>
      <description>&lt;P&gt;Quite old question but yes, that was essentially the solution (can't remember exactly). I seem to have created a wrapper component to hold the ArcGIS map which handled all the encoding and parsing as I could not do it directly with the ArcGIS map due to the JSON parsing issue. Hopefully this helps you out too.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Dec 2023 19:42:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-core-workers-failed-to-create-worker-json/m-p/1356151#M82996</guid>
      <dc:creator>ConnerFarrant</dc:creator>
      <dc:date>2023-12-03T19:42:31Z</dc:date>
    </item>
  </channel>
</rss>

