<?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: intl fetchMessageBundle cannot find JSON loader in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/intl-fetchmessagebundle-cannot-find-json-loader/m-p/1041873#M72264</link>
    <description>&lt;P&gt;We found the issue...&amp;nbsp;&lt;/P&gt;&lt;P&gt;we copied the example found &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-intl.html#registerMessageBundleLoader" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;and we discovered that the regex variable&amp;nbsp;&lt;SPAN&gt;patternBundle is wrong. We removed the ending /g, so the variable is not a global one any more. That's it!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Mar 2021 09:37:00 GMT</pubDate>
    <dc:creator>MichailMarinakis1</dc:creator>
    <dc:date>2021-03-30T09:37:00Z</dc:date>
    <item>
      <title>intl fetchMessageBundle cannot find JSON loader</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/intl-fetchmessagebundle-cannot-find-json-loader/m-p/1040184#M72176</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the new JS API version 4.18, we are using the new way to translate custom widgets by using the new &lt;SPAN&gt;decorator in the tsx files&amp;nbsp;&lt;/SPAN&gt;e.g.&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;messageBundle&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"gis/commonMessages"&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;&lt;SPAN&gt;Most of the times it is working, including multiple JSON files with different names but some times when we destroy the widget and recreate it, it cannot find the loader.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;In other cases we cannot use this decorator and we need to use the method&amp;nbsp;fetchMessageBundle to get our messages. So we do something like this&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;SPAN&gt;await&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;intl&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;fetchMessageBundle&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"gis/widgetMessages"&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;then&lt;/SPAN&gt;&lt;SPAN&gt;((&lt;/SPAN&gt;&lt;SPAN&gt;messages&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;any&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;nbsp; =&amp;gt; {})&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;In both use cases, the JSON is accessible from the site, and the JSONloader is correctly loaded, but we receive the error message there is no loader for these messages.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;We try to debug a bit, and there is a weird behavior with a regex query when it tries to find the loader. The first time it tries to find the loader it returns false, the second it returns true, the third it returns false the fourth true etc etc.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;We suspect it is a bug, ooor we are doing something wrong&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Please let us know about any feedback!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 24 Mar 2021 16:14:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/intl-fetchmessagebundle-cannot-find-json-loader/m-p/1040184#M72176</guid>
      <dc:creator>MichailMarinakis1</dc:creator>
      <dc:date>2021-03-24T16:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: intl fetchMessageBundle cannot find JSON loader</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/intl-fetchmessagebundle-cannot-find-json-loader/m-p/1041873#M72264</link>
      <description>&lt;P&gt;We found the issue...&amp;nbsp;&lt;/P&gt;&lt;P&gt;we copied the example found &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-intl.html#registerMessageBundleLoader" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;and we discovered that the regex variable&amp;nbsp;&lt;SPAN&gt;patternBundle is wrong. We removed the ending /g, so the variable is not a global one any more. That's it!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 09:37:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/intl-fetchmessagebundle-cannot-find-json-loader/m-p/1041873#M72264</guid>
      <dc:creator>MichailMarinakis1</dc:creator>
      <dc:date>2021-03-30T09:37:00Z</dc:date>
    </item>
  </channel>
</rss>

