TypeError: domConstruct.create is not a function[Learn More]

2812
3
Jump to solution
01-09-2017 11:50 PM
Traspac
New Contributor II

domconstruc.create isnot function

[ASK]

Why domConstruct isnot found?
it's look like dojo didnot load.
please help.
Thank you

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Tras,

   You made a basic mistake most new AMD style coding develop make. Your require vars do not match your require list.

You have:

reguire(["esri/map",
        "esri/tasks/IdentifyParameters",
        "esri/tasks/IdentifyTask",
        "esri/Layers/ArcGISDynamicMapServiceLayer",
        "esri/symbols/SimpleFillSymbol",
        "esri/symbols/SimpleLineSymbol",
        "esri/InfoTemplate",
        "esri/Color",
        "esri/dijit/Popup",
        "dojo/_base/array",
        "dojo/dom-construct",
        "dojo/domReady!"
], function(Map, IdentifyParameter, IdentifyTask, ArcGISDynamicMapServiceLayer, SimpleFillSymbol,
              SimpleLineSymbol,Popup,Color, InfoTemplate, Popup, arrayUtils, domConstruct){‍‍‍‍‍‍‍‍‍‍‍‍‍‍

In there you have popup twice and InfoTemplate and popup switched:

It should be:

reguire(["esri/map",
        "esri/tasks/IdentifyParameters",
        "esri/tasks/IdentifyTask",
        "esri/Layers/ArcGISDynamicMapServiceLayer",
        "esri/symbols/SimpleFillSymbol",
        "esri/symbols/SimpleLineSymbol",
        "esri/InfoTemplate",
        "esri/Color",
        "esri/dijit/Popup",
        "dojo/_base/array",
        "dojo/dom-construct",
        "dojo/domReady!"
], function(Map, IdentifyParameter, IdentifyTask, ArcGISDynamicMapServiceLayer, SimpleFillSymbol,
              SimpleLineSymbol, InfoTemplate, Color, Popup, arrayUtils, domConstruct){‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Notice that alignment of the require for "esri/InfoTemplate", and its matching var InfoTemplate have to appear in the exact order that the require list has them in.

The abc’s of AMD | ArcGIS Blog 

View solution in original post

3 Replies
RobertScheitlin__GISP
MVP Emeritus

Tras,

   You made a basic mistake most new AMD style coding develop make. Your require vars do not match your require list.

You have:

reguire(["esri/map",
        "esri/tasks/IdentifyParameters",
        "esri/tasks/IdentifyTask",
        "esri/Layers/ArcGISDynamicMapServiceLayer",
        "esri/symbols/SimpleFillSymbol",
        "esri/symbols/SimpleLineSymbol",
        "esri/InfoTemplate",
        "esri/Color",
        "esri/dijit/Popup",
        "dojo/_base/array",
        "dojo/dom-construct",
        "dojo/domReady!"
], function(Map, IdentifyParameter, IdentifyTask, ArcGISDynamicMapServiceLayer, SimpleFillSymbol,
              SimpleLineSymbol,Popup,Color, InfoTemplate, Popup, arrayUtils, domConstruct){‍‍‍‍‍‍‍‍‍‍‍‍‍‍

In there you have popup twice and InfoTemplate and popup switched:

It should be:

reguire(["esri/map",
        "esri/tasks/IdentifyParameters",
        "esri/tasks/IdentifyTask",
        "esri/Layers/ArcGISDynamicMapServiceLayer",
        "esri/symbols/SimpleFillSymbol",
        "esri/symbols/SimpleLineSymbol",
        "esri/InfoTemplate",
        "esri/Color",
        "esri/dijit/Popup",
        "dojo/_base/array",
        "dojo/dom-construct",
        "dojo/domReady!"
], function(Map, IdentifyParameter, IdentifyTask, ArcGISDynamicMapServiceLayer, SimpleFillSymbol,
              SimpleLineSymbol, InfoTemplate, Color, Popup, arrayUtils, domConstruct){‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Notice that alignment of the require for "esri/InfoTemplate", and its matching var InfoTemplate have to appear in the exact order that the require list has them in.

The abc’s of AMD | ArcGIS Blog 

Traspac
New Contributor II

Thank's very much Robert Scheitlin, GISP.
it's helpfull

TimWitt2
MVP Alum