4

I am struggling with setting up arcgis javascript api locally. Tried following https://developers.arcgis.com/javascript/latest/guide/get-api/index.html#using-bower-for-local-builds but no use. No help from sample application https://github.com/Esri/jsapi-resources.git

  • Bower installs arcgis-js-api
  • I setup a dojoConfig file
  • npm install
  • bower install
  • grunt build => FAIL

    Error: Cannot find module "src/dojo/dojo.js"

how is it supposed to work since bower installed packages are not npm ready. cannot be dynamically loaded. Whiskey Tango Foxtrot. please help.

Tried a yeoman generator arcgis-js-app still no good. I get the same error /sampleapp/src/dojo/dojo.js" Error (404): "Not found"

Jabran Saeed
  • 5,760
  • 3
  • 21
  • 37

2 Answers2

1

Assuming you are working with the sample application as is (i.e. you're not modifying it yet), then it sounds like your bower install failed. Under src you should see folders like esri and dojo - if they are not there, then the bower install did not complete.

Tom Wayson
  • 1,187
  • 1
  • 12
  • 21
0

You can configure Dojo like :

  var dojoConfig = {
  baseUrl: '.',
  packages: [
  {
    name: 'dgrid',
    location: 'bower_components/dgrid',
  },
  {
    name: 'dijit',
    location: 'bower_components/dijit',
  },
  {
    name: 'dojo',
    location: 'bower_components/dojo',
  },
  {
    name: 'dojox',
    location: 'bower_components/dojox',
  },
  {
    name: 'dstore',
    location: 'bower_components/dstore',
  },
  {
    name: 'esri',
    location: 'bower_components/esri',
  },
  {
    name: 'put-selector',
    location: 'bower_components/put-selector',
  },
  {
    name: 'xstyle',
    location: 'bower_components/xstyle',
  }
  ]
  };

or configure bower (in .bowerrc):

{
"directory":"src/"
}

Source: official documentation.

Lavock
  • 341
  • 3
  • 7