MultipleDefine error while loading the modules from ArcGIS javascript API

08-31-2018 05:56 AM
New Contributor

I have a page where I am loading jQuery using <script> tag. I also have another custom JS file referenced using <script> tag following jQuery <script> tag. My page also references other JavaScript libraries like - momentJS, jQuery.i18n

In custom JS file, I am loading ArcGIS 4.8 JavaScript API using $.getScript() function inside the callback function of $.getScript(), I am loading ArcGIS modules as below. 

HTML script references - 

<script >

<script >


customJS.js file - 

var dojoConfig =

         packages: [{
         name: "jquery",
         location: "/sites/DW/_catalogs/masterpage/scripts",
         main: "jquery-2.1.4.min"
         name: "dojo",
         location: "",
         main: "dojo"

$.getScript("", function () {
], function (Map, MapView, Graphic, Point, PictureMarkerSymbol, Extent, esriConfig) {

          var map = new Map({
                  basemap: "streets"
         var view = new MapView({
                  container: "map",
                  map: map,



When I try to load my page, it throws an error 'multipleDefine' in dojo.js.

The variable dojoConfig declared and initialized to resolve any loading conflicts but it didn't resolve the error. If I remove this variable, it throws the same error. The error screen shot is attached.

I have not previously worked on AMD and I am sure I am doing something wrong. Can anyone help me fix this problem or provide any directions or documentation ? Any help or direction is appreciated.

0 Kudos
1 Reply
MVP Esteemed Contributor


   The dojo config has to be first thing in your html in a script tag. Normally I see the esri JS API added after the jQuery library in the main html also (not using jQuery getScript).