<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [esri.views.MapView] #container element with id 'viewDiv' not found in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-views-mapview-container-element-with-id/m-p/1326119#M82177</link>
    <description>&lt;P&gt;Ah, good to know and no worries. I moved the loading gif back to where it was and everything seems a okay - for now&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grimacing_face:"&gt;😬&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Sep 2023 20:12:14 GMT</pubDate>
    <dc:creator>luckachi</dc:creator>
    <dc:date>2023-09-06T20:12:14Z</dc:date>
    <item>
      <title>[esri.views.MapView] #container element with id 'viewDiv' not found</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-views-mapview-container-element-with-id/m-p/1325904#M82161</link>
      <description>&lt;P&gt;We are now receiving this error message on our web maps, which unfortunately doesn't tell me much considering the element 'viewDiv' does exist. Nothing has changed in the code other than updating to 4.27.&amp;nbsp;Images show in the code where the viewDiv is mentioned. Help would be appreciated as this map is used quite frequently.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-09-06 102058.png" style="width: 452px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/79968iF95D977DBC808D20/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-09-06 102058.png" alt="Screenshot 2023-09-06 102058.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-09-06 102111.png" style="width: 620px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/79966i9918D31A747380DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-09-06 102111.png" alt="Screenshot 2023-09-06 102111.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-09-06 102210.png" style="width: 644px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/79965i339A9A36BAAFBB16/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-09-06 102210.png" alt="Screenshot 2023-09-06 102210.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-09-06 102127.png" style="width: 942px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/79969iE30B616D08B4AFDF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-09-06 102127.png" alt="Screenshot 2023-09-06 102127.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 14:42:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-views-mapview-container-element-with-id/m-p/1325904#M82161</guid>
      <dc:creator>luckachi</dc:creator>
      <dc:date>2023-09-06T14:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: [esri.views.MapView] #container element with id 'viewDiv' not found</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-views-mapview-container-element-with-id/m-p/1326041#M82167</link>
      <description>&lt;P&gt;It appears to be because you have a child element (an img) within that div.&amp;nbsp; Evidently the SDK expects an empty div for a container.&amp;nbsp; You should be able to accomplish the same functionality by moving the img element into the div one level up.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 17:47:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-views-mapview-container-element-with-id/m-p/1326041#M82167</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-09-06T17:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: [esri.views.MapView] #container element with id 'viewDiv' not found</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-views-mapview-container-element-with-id/m-p/1326069#M82169</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/6522"&gt;@JoelBennett&lt;/a&gt;&amp;nbsp;... unfortunately moving the loading element to a different div did not solve the problem. Still returning an error and the loading animation just spins without the map loading. It also doesn't resolve the issue if I completely remove the gif.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-09-06 140135.png" style="width: 918px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/80015i26A4AA5D31EECDCA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-09-06 140135.png" alt="Screenshot 2023-09-06 140135.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-09-06 140149.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/80016iC0E3F6E3F9342B76/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-09-06 140149.png" alt="Screenshot 2023-09-06 140149.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 18:05:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-views-mapview-container-element-with-id/m-p/1326069#M82169</guid>
      <dc:creator>luckachi</dc:creator>
      <dc:date>2023-09-06T18:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: [esri.views.MapView] #container element with id 'viewDiv' not found</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-views-mapview-container-element-with-id/m-p/1326091#M82170</link>
      <description>&lt;P&gt;Hmm...I arrived at that by getting the same error when adding an img to the div used by the mapview container.&lt;/P&gt;&lt;P&gt;The most common reason for this error would be that the div doesn't exist in the DOM at the time you're trying to access it.&amp;nbsp; What do you get if you place the code below before the MapView constructor?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;console.log(document.getElementById("viewDiv") == null);&lt;/LI-CODE&gt;&lt;P&gt;If it says "true" then that's the issue, in which case I would recommend moving the script tag that starts up your application to a place lower in the document (perhaps right before the closing body tag).&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 19:05:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-views-mapview-container-element-with-id/m-p/1326091#M82170</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-09-06T19:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: [esri.views.MapView] #container element with id 'viewDiv' not found</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-views-mapview-container-element-with-id/m-p/1326103#M82171</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/6522"&gt;@JoelBennett&lt;/a&gt;&amp;nbsp;- it did return "true".&amp;nbsp; When you say the script tag, are you referring to the whole esri map code or a specific section? Right now the php has some script and style blocks at the top for screen sizes, the script for the loading icon, then the esri map code, then some div formatting for different screen sizes for drop down menus, then the map section. We actually do not have any &amp;lt;body&amp;gt; tags.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-09-06 155424.png" style="width: 562px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/80021iD737E6B224B8F39B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-09-06 155424.png" alt="Screenshot 2023-09-06 155424.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-09-06 155447.png" style="width: 526px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/80022iF27199EB80E137E6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-09-06 155447.png" alt="Screenshot 2023-09-06 155447.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 19:55:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-views-mapview-container-element-with-id/m-p/1326103#M82171</guid>
      <dc:creator>luckachi</dc:creator>
      <dc:date>2023-09-06T19:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: [esri.views.MapView] #container element with id 'viewDiv' not found</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-views-mapview-container-element-with-id/m-p/1326109#M82172</link>
      <description>&lt;P&gt;It's likely the part you're referring to as the esri map code.&amp;nbsp; All of that should be contained within a &amp;lt;script&amp;gt; tag, and you can probably just cut and paste that right before the closing body tag.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;html&amp;gt;
&amp;lt;!-- etc --&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;!-- etc --&amp;gt;
&amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;!-- etc --&amp;gt;
&amp;lt;script type="text/javascript"&amp;gt;
	//etc
	var view = new MapView({
		//etc
	});
	//etc
&amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 19:56:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-views-mapview-container-element-with-id/m-p/1326109#M82172</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-09-06T19:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: [esri.views.MapView] #container element with id 'viewDiv' not found</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-views-mapview-container-element-with-id/m-p/1326113#M82174</link>
      <description>&lt;P&gt;Looks like moving the entire esri block to just before the "viewDiv" section did the trick!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 19:59:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-views-mapview-container-element-with-id/m-p/1326113#M82174</guid>
      <dc:creator>luckachi</dc:creator>
      <dc:date>2023-09-06T19:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: [esri.views.MapView] #container element with id 'viewDiv' not found</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-views-mapview-container-element-with-id/m-p/1326115#M82176</link>
      <description>&lt;P&gt;Sounds good.&amp;nbsp; On a side note, the container can contain child elements.&amp;nbsp; It is not a requirement of the SDK that the container have no child elements, as I erroneously suggested previously.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 20:06:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-views-mapview-container-element-with-id/m-p/1326115#M82176</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-09-06T20:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: [esri.views.MapView] #container element with id 'viewDiv' not found</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-views-mapview-container-element-with-id/m-p/1326119#M82177</link>
      <description>&lt;P&gt;Ah, good to know and no worries. I moved the loading gif back to where it was and everything seems a okay - for now&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grimacing_face:"&gt;😬&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 20:12:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-views-mapview-container-element-with-id/m-p/1326119#M82177</guid>
      <dc:creator>luckachi</dc:creator>
      <dc:date>2023-09-06T20:12:14Z</dc:date>
    </item>
  </channel>
</rss>

