title: dojo/parser::parse() error TypeError {stack: (…), message: “Cannot read property 'toString' of undefined”}
body: <p>I'm trying to get the overview map example working from here:</p>
  
  <p><a href="https://developers.arcgis.com/javascript/jssamples/widget_overviewmap.html" rel="nofollow noreferrer">https://developers.arcgis.com/javascript/jssamples/widget_overviewmap.html</a></p>
  
  <p>in my site.  I have two errors. Chrome gives the one above in the title and IE gives "dojo/parser::parse() errorTypeError: Unable to get property 'toString' of undefined or null reference".</p>
  
  <p>Also Chrome gives me the error: Uncaught TypeError: undefined is not a function when I have the OverviewMap variable in my function, IE says SCRIPT438: Object doesn't support property or method 'byId'.   If I comment it out like this:</p>
  
  <pre><code>/*OverviewMap,*/ dom) {
  </code></pre>
  
  <p>and the reference to it below, I don't get those second two errors.</p>
  
  <p>looked at this one: <a href="https://gis.stackexchange.com/questions/86674/arcgis-api-for-javascript-error-in-dojo-parser-parse">https://gis.stackexchange.com/questions/86674/arcgis-api-for-javascript-error-in-dojo-parser-parse</a></p>
  
  <p>I noticed that in my .cshtml file below, I don't have the Lang=en , but it was added into the HTML when I was looking at the console. So I added this: </p>
  
  <pre><code>&lt;script&gt;
      dojoConfig = {       
          locale: 'en-us'
      };
  &lt;/script&gt;
  </code></pre>
  
  <p>but no change.</p>
  
  <pre><code>@model Site.Models.LoginModel
  @{
      ViewBag.Title = "My Map";
  
  }
  @functions{
      public string GetAntiForgeryToken()
      {
          string cookieToken, formToken;
          AntiForgery.GetTokens(null, out cookieToken, out formToken);
          return cookieToken + ":" + formToken;                
      }
  }
  
  
  
  @if (1==1)
  {
      @section toolbar {
          &lt;li&gt;
              &lt;div id="navToolbar" data-dojo-type="dijit/Toolbar" style="display:none"&gt;
        &lt;div data-dojo-type="dijit/form/Button" id="printSimple" data-dojo-props="iconClass:'esriPrintIcon', label:'Print'"&gt;&lt;/div&gt;
        &lt;div data-dojo-type="dijit.form.Button" id="measure" data-dojo-props="label:'Measure', iconClass:'esriMeasureIcon'"&gt;&lt;/div&gt;
        &lt;div data-dojo-type="dijit/form/Button" id="zoomin"  data-dojo-props="iconClass:'zoominIcon'"&gt;Zoom In&lt;/div&gt;
        &lt;div data-dojo-type="dijit/form/Button" id="zoomout" data-dojo-props="iconClass:'zoomoutIcon'"&gt;Zoom Out&lt;/div&gt;
        &lt;div data-dojo-type="dijit/form/Button" id="zoomfullext" data-dojo-props="iconClass:'zoomfullextIcon'"&gt;Full Extent&lt;/div&gt;
        &lt;div data-dojo-type="dijit/form/Button" id="zoomprev" data-dojo-props="iconClass:'zoomprevIcon'"&gt;Prev Extent&lt;/div&gt;
        &lt;div data-dojo-type="dijit/form/Button" id="zoomnext" data-dojo-props="iconClass:'zoomnextIcon'"&gt;Next Extent&lt;/div&gt;
        &lt;div data-dojo-type="dijit/form/Button" id="pan" data-dojo-props="iconClass:'panIcon'"&gt;Pan&lt;/div&gt;
        &lt;div data-dojo-type="dijit/form/Button" id="deactivate" data-dojo-props="iconClass:'deactivateIcon'"&gt;Deactivate&lt;/div&gt;
                  &lt;/div&gt;
          &lt;/li&gt;
          &lt;!--        
          &lt;li&gt;
              &lt;img src='@Href("~/Images/map/identify_b.png")' /&gt;
          &lt;/li&gt;
           &lt;li&gt;
              &lt;img src='@Href("~/Images/map/zoom_in_b.png")' /&gt;
          &lt;/li&gt;
          &lt;li&gt;
              &lt;img src='@Href("~/Images/map/zoom_out_b.png")' /&gt;
          &lt;/li&gt;
           &lt;li&gt;
              &lt;img src='@Href("~/Images/map/pan_b.png")' /&gt;
          &lt;/li&gt;
        &lt;li&gt;
              &lt;img src='@Href("~/Images/map/global_b.png")' /&gt;
          &lt;/li&gt;
  
          &lt;li&gt;
              &lt;img src='@Href("~/Images/map/print_b.png")' /&gt;
          &lt;/li&gt; --&gt;
          }
  
  
      &lt;div class="row-fluid" style="height:100%"&gt;
          &lt;input id="antiForgeryToken" type="hidden" value="@GetAntiForgeryToken()" /&gt;
          &lt;div class="col col-lg-2 visible-desktop" &gt;Sidebar&lt;/div&gt;
  
       &lt;!-- Bootstrap-map-js --&gt;
          &lt;div class="col col-lg-10"&gt;
                              &lt;div style="position:absolute; right:20px; top:10px; z-Index:999;"&gt;
                      &lt;div id="titlePane" data-dojo-type="dijit.TitlePane" data-dojo-props="title:'Measurement', closable:'true', open:'false'"&gt;
                          &lt;div id="measurementDiv"&gt;&lt;/div&gt;
  
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;div id="mapDiv" data-dojo-type="dijit/layout/ContentPane"
                   data-dojo-props="region:'center'"
                   style="padding:0"&gt;
  
              &lt;/div&gt;
         &lt;/div&gt;
  
      &lt;/div&gt;
  }
  else
  {
      &lt;div class="todoList" id="loginPanel"&gt;
          &lt;section id="localLoginPanel"&gt;
              &lt;h2&gt;Log in&lt;/h2&gt;
              @Html.Partial("_Login")
          &lt;/section&gt;
          &lt;section id="socialLoginPanel"&gt;
              &lt;h2&gt;Log in using another service&lt;/h2&gt;
              @Html.Action("ExternalLoginsList", "Account", new { ReturnUrl = ViewBag.ReturnUrl })
          &lt;/section&gt;
          &lt;p&gt;First time here? &lt;a id="showRegister"&gt;Sign up&lt;/a&gt;&lt;/p&gt;
      &lt;/div&gt;
      &lt;div class="todoList" id="registerPanel"&gt;
          &lt;h2&gt;Sign up&lt;/h2&gt;
          @Html.Partial("_Register")
          &lt;p&gt;Already signed up? &lt;a id="showLogin"&gt;Log in&lt;/a&gt;&lt;/p&gt;
      &lt;/div&gt;
  }
  &lt;/div&gt;
  
  @if (1==1)
  {
  
  
      @section styles {
        @Styles.Render("~/bundles/bootstrap/map/css")
          &lt;link rel= "stylesheet" type="text/css" href="http://js.arcgis.com/3.9/js/dojo/dijit/themes/claro/claro.css" /&gt;
        &lt;link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.9/js/esri/css/esri.css"/&gt;   
  
  
          }
  
      @section scripts {
  
  
  
          &lt;!--
          @Scripts.Render("~/bundles/knockout")
          @Scripts.Render("~/bundles/jqueryval")
          @Scripts.Render("~/bundles/todo") --&gt;
  
  
         &lt;script src="http://js.arcgis.com/3.9/"&gt;&lt;/script&gt;
  
  &lt;script&gt;
      dojoConfig = {       
          locale: 'en-us'
      };
  &lt;/script&gt;
  
  
          &lt;script&gt;
              require(["esri/map", "application/bootstrapmap", "esri/toolbars/navigation",
          "dojo/on",
          "dojo/parser",
          "dijit/registry",
          "dijit/Toolbar",
          "dijit/form/Button",
            "esri/SnappingManager",
            "esri/dijit/Measurement",
            "dojo/dom",
  
          "esri/dijit/Scalebar",
           "dijit/layout/BorderContainer",
           "dijit/layout/ContentPane",
           "dijit/TitlePane",
           "esri/dijit/OverviewMap",
           "dojo/domReady!",
  
  
  
              ],
              function (Map, BootstrapMap, Navigation, on, parser, registry, Toolbar, Button, SnappingManager, Measurement, OverviewMap, dom) {
                var map = BootstrapMap.create("mapDiv",{
                    basemap:"national-geographic",
                    center:[-122.45,37.77],
                    zoom:12,
                    autoResize: true
                });
  
  
                parser.parse();
  
                navToolbar = new Navigation(map);
  
                on(navToolbar, "onExtentHistoryChange", extentHistoryChangeHandler);
                registry.byId("zoomin").on("click", function () {
                    navToolbar.activate(Navigation.ZOOM_IN);
                });
  
                registry.byId("zoomout").on("click", function () {
                    navToolbar.activate(Navigation.ZOOM_OUT);
                });
  
                registry.byId("zoomfullext").on("click", function () {
                    navToolbar.zoomToFullExtent();
                });
  
                registry.byId("zoomprev").on("click", function () {
                    navToolbar.zoomToPrevExtent();
                });
  
                registry.byId("zoomnext").on("click", function () {
                    navToolbar.zoomToNextExtent();
                });
  
                registry.byId("pan").on("click", function () {
                    navToolbar.activate(Navigation.PAN);
                });
  
                registry.byId("deactivate").on("click", function () {
                    navToolbar.deactivate();
                });
  
                $('#navToolbar').show();
  
                esri.config.defaults.geometryService = new esri.tasks.GeometryService("http://sampleserver3.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer");
  
                 measurement = new Measurement({
                    map: map
                }, dom.byId("measurementDiv"));
                measurement.startup();
  
                registry.byId("measure").on("click", function () {
                    measurement.show();
                });
  
                function extentHistoryChangeHandler() {
                    $("#zoomprev").disabled = navToolbar.isFirstExtent();
                    $("#zoomnext").disabled = navToolbar.isLastExtent();
                }
  
                var overviewMapDijit = new OverviewMap({
                    map: map,
                    visible: true
                });
                overviewMapDijit.startup();
  
            });
      &lt;/script&gt;
  
      }
  }
  </code></pre>
  
  <p>EDIT based on answer:</p>
  
  <pre><code>.
  .
  .
      "esri/dijit/OverviewMap",
           "dojo/domReady!",
   ],
              function (Map, BootstrapMap, Navigation, on, parser, registry, Toolbar, Button, SnappingManager, Measurement, OverviewMap, dom) {
  .
  .
  .
  </code></pre>
  
  <p>but didn't fix it</p>