<?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 Moment Library not loading correctly in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/moment-library-not-loading-correctly/m-p/1140329#M14695</link>
    <description>&lt;P&gt;I am working on a Web AppBuilder application that uses 3rd party libraries. One of these libraries includes the &lt;A href="https://momentjs.com/timezone/docs/" target="_self"&gt;Moment&lt;/A&gt; and Moment-Timezone libraries. On load, I immediately get and error: 'Uncaught TypeError: Cannot read properties of undefined (reading 'tz')'. Researching this; I found an &lt;A href="https://stackoverflow.com/questions/28531167/cannot-read-property-tz-of-undefined-ember-moment-timezone" target="_self"&gt;article&lt;/A&gt; that point to the source of this problem being due to the moment-timezone-with-data-min.js file loading before the moment-min.js file. I am not sure where to make this change within my app. It looks like the libs get loaded as resources in my `init.js` file and I have placed them in the proper order there. Is there another folder or file with dependencies? I also see that in the libs folder, there is a moment folder and the files are in this order. How can I change this order so they load properly. Or is there another issue I may be overlooking?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Moment.PNG" style="width: 409px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/33019iEA8B960E9A5F9253/image-size/large?v=v2&amp;amp;px=999" role="button" title="Moment.PNG" alt="Moment.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Feb 2022 15:17:38 GMT</pubDate>
    <dc:creator>JustinBridwell2</dc:creator>
    <dc:date>2022-02-03T15:17:38Z</dc:date>
    <item>
      <title>Moment Library not loading correctly</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/moment-library-not-loading-correctly/m-p/1140329#M14695</link>
      <description>&lt;P&gt;I am working on a Web AppBuilder application that uses 3rd party libraries. One of these libraries includes the &lt;A href="https://momentjs.com/timezone/docs/" target="_self"&gt;Moment&lt;/A&gt; and Moment-Timezone libraries. On load, I immediately get and error: 'Uncaught TypeError: Cannot read properties of undefined (reading 'tz')'. Researching this; I found an &lt;A href="https://stackoverflow.com/questions/28531167/cannot-read-property-tz-of-undefined-ember-moment-timezone" target="_self"&gt;article&lt;/A&gt; that point to the source of this problem being due to the moment-timezone-with-data-min.js file loading before the moment-min.js file. I am not sure where to make this change within my app. It looks like the libs get loaded as resources in my `init.js` file and I have placed them in the proper order there. Is there another folder or file with dependencies? I also see that in the libs folder, there is a moment folder and the files are in this order. How can I change this order so they load properly. Or is there another issue I may be overlooking?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Moment.PNG" style="width: 409px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/33019iEA8B960E9A5F9253/image-size/large?v=v2&amp;amp;px=999" role="button" title="Moment.PNG" alt="Moment.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 15:17:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/moment-library-not-loading-correctly/m-p/1140329#M14695</guid>
      <dc:creator>JustinBridwell2</dc:creator>
      <dc:date>2022-02-03T15:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Moment Library not loading correctly</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/moment-library-not-loading-correctly/m-p/1141802#M14697</link>
      <description>&lt;P&gt;Can it be loaded thru the widget:&lt;/P&gt;&lt;P&gt;// Load Extrenal Libs&lt;BR /&gt;require({&lt;BR /&gt;paths: {&lt;BR /&gt;react:&lt;BR /&gt;'&lt;A href="https://cdnjs.cloudflare.com/ajax/libs/react/16.8.6/umd/react.production.min" target="_blank"&gt;https://cdnjs.cloudflare.com/ajax/libs/react/16.8.6/umd/react.production.min&lt;/A&gt;',&lt;BR /&gt;'react-dom':&lt;BR /&gt;'&lt;A href="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.8.6/umd/react-dom.production.min" target="_blank"&gt;https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.8.6/umd/react-dom.production.min&lt;/A&gt;',&lt;BR /&gt;},&lt;BR /&gt;});&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 20:52:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/moment-library-not-loading-correctly/m-p/1141802#M14697</guid>
      <dc:creator>LaurynasGedminas2</dc:creator>
      <dc:date>2022-02-08T20:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Moment Library not loading correctly</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/moment-library-not-loading-correctly/m-p/1142153#M14698</link>
      <description>&lt;P&gt;In what file do you propose adding the above code? The main widget.js? If so, I am using WabVersion 2.20, and I don't see any 'require'. I do have 'define(['&amp;lt;path to libs&amp;gt;'], function(&amp;lt;lib_name&amp;gt;) {&amp;lt;code goes here&amp;gt;});' in my widget.js file? Is there another file I would add that to? I already have it in my main init.js file as mentioned, but that does not seem to guarantee it gets loaded in the proper order:&lt;/P&gt;&lt;P&gt;From init.js:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;resources = resources.concat([&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; window.apiUrl + &lt;/SPAN&gt;&lt;SPAN&gt;'dojo/resources/dojo.css'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; window.apiUrl + &lt;/SPAN&gt;&lt;SPAN&gt;'dijit/themes/claro/claro.css'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; window.apiUrl + &lt;/SPAN&gt;&lt;SPAN&gt;'esri/css/esri.css'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; window.path + &lt;/SPAN&gt;&lt;SPAN&gt;'jimu.js/css/jimu-theme.css'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; window.path + &lt;/SPAN&gt;&lt;SPAN&gt;'libs/moment/moment.min.js'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; window.path + &lt;/SPAN&gt;&lt;SPAN&gt;'libs/moment/twix.js'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; window.path + &lt;/SPAN&gt;&lt;SPAN&gt;'libs/moment/moment-timezone-with-data.min.js'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ])&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 15:53:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/moment-library-not-loading-correctly/m-p/1142153#M14698</guid>
      <dc:creator>JustinBridwell2</dc:creator>
      <dc:date>2022-02-09T15:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Moment Library not loading correctly</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/moment-library-not-loading-correctly/m-p/1142196#M14699</link>
      <description>&lt;P&gt;Yes, in the Widget.js file:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LaurynasGedminas2_0-1644425710912.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/33509i008382201299847F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LaurynasGedminas2_0-1644425710912.png" alt="LaurynasGedminas2_0-1644425710912.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 16:55:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/moment-library-not-loading-correctly/m-p/1142196#M14699</guid>
      <dc:creator>LaurynasGedminas2</dc:creator>
      <dc:date>2022-02-09T16:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Moment Library not loading correctly</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/moment-library-not-loading-correctly/m-p/1142204#M14700</link>
      <description>&lt;P&gt;OK, just to clarify; Should I add that `require({ paths: { moment: '&amp;lt;path to moment&amp;gt;}});` at the top and then add it underneath in my `define({'moment'}), as well?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 17:10:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/moment-library-not-loading-correctly/m-p/1142204#M14700</guid>
      <dc:creator>JustinBridwell2</dc:creator>
      <dc:date>2022-02-09T17:10:17Z</dc:date>
    </item>
  </channel>
</rss>

