AnsweredAssumed Answered

Javacript 3.23 bug with momentjs package?

Question asked by eric.oneal_LWC on Apr 16, 2018
Latest reply on Apr 19, 2018 by eric.oneal_LWC

I'm attempting to use a 3rd party library in a WAB custom widget, and there is a dependency for momentjs.  Moment seems to be packaged with the ESRI Javascript API, but has a different definition for 'main' in init.js than the other packages (notice the .js on the end of it):  


}, {
location: "../xstyle",
name: "xstyle"
}, {
location: "../dgrid",
main: "OnDemandGrid",
name: "dgrid"
}, {
location: "../dgrid1",
main: "OnDemandGrid",
name: "dgrid1"
}, {
location: "../dstore",
main: "Store",
name: "dstore"
}, {
location: "../moment",
main: "moment.js",
name: "moment"
}, {
location: "../esri",
name: "esri"
}, {
location: ".",
name: "dojo"

When the define line is executed in the 3rd party library, it fails with:

GET https://js.arcgis.com/3.21/moment/moment.js.js net::ERR_ABORTED

It seems that the extra .js on moment in init.js is crapping things out and I notice that this has changed in JS API version 4.6.

Outcomes