Esri / esri-wab-build

Package used to build ESRI Web App Builder Apps for production.
Apache License 2.0
17 stars 5 forks source link

Missing moment locale file if not EN #74

Open BDvirus opened 4 years ago

BDvirus commented 4 years ago

Hi,

I created a vanilla app (just a basemap) with WAB Dev Edition 2.12 After built change env to load local and https://wab.local/arcgis-js-api/moment/locale/he.js?wab_dv=2.12 is missing also /arcgis-js-api/dijit/_BidiMixin.js?wab_dv=2.12 is missing

It's happens also in WAB 2.8

image

cancastilho commented 4 years ago

I had the same problem with moment with pt-br locale and the dojox/widget/ColorPicker dependency.

What solved for me was open the node_modules/esri-wab-build/app/_app.profile.js and include the 3 lines inside "dojo/dojo" layer section:

//...
  layers: {
    "dojo/dojo": {
      boot: true,
      customBase: false,
      include: [
        "esri/jsapi",
        "esri/layers/unitBezier",
        "esri/SnappingManager",
        "dojox/gfx/path",
        "dojox/gfx/svg",
        "dojox/gfx/filters",
        "dojox/gfx/svgext",
        "dojox/gfx/shape",
        "esri/dijit/Attribution",
        "esri/IdentityManager",
        "dojox/xml/parser",
        "xstyle/core/load-css",
        "dgrid/TouchScroll",
        "dgrid/util/touch",
        "dgrid/util/has-css3",
        "dojo/selector/lite",

         //here
        "dojox/widget/ColorPicker",
        "moment/moment",
        "moment/locale/pt-br"
      ]
    },
//...

In your case would be moment/locale/he.

Then try to run esri-wab-build again. Let me know if there is another way to solve this.

BDvirus commented 4 years ago

Works like a charm.. Thanks @cancastilho

Let's hope it's the correct way to solve this.

Notes: RTL languages like Hebrew, it's need to add also dijit/_BidiMixin To solve the first error above.

Tested with WAB 2.16

rsjones commented 4 years ago

@cancastilho do you know if it was your class that was missing an include for dojox.widget.ColorPicker or one of the WAB classes?

cancastilho commented 4 years ago

@cancastilho do you know if it was your class that was missing an include for dojox.widget.ColorPicker or one of the WAB classes?

dojox.widget.ColorPicker is used, indirectly, by Draw widget, which I was using in my project. Hence, the error occurred to me.

The dependency graph is as follows: Draw Widget.js -> jimu/dijit/SymbolChooser -> jimu/dijit/ColorPicker -> dojox/widget/ColorPicker.