Require Undefined on server

5561
2
Jump to solution
08-05-2014 03:33 PM
asinha_ppc
New Contributor II


I have a simple site that works fine locally, but when I host it on our IIS server, I get "Uncaught ReferenceError: require is not defined".

I have attached the source code. I am a JS newbie and believe this has something to do with the Dojo toolkit. Any hint will be appreciated!

Thanks!

0 Kudos
1 Solution

Accepted Solutions
OwenEarley
Occasional Contributor III

Your page does not seem to be loading the ESRI JS API:

// Reference the ESRI JS API (add the next line before creating a map)

<script src="http://js.arcgis.com/3.9/"></script>

<script>

    var map;

   

    require([

      "esri/InfoTemplate",

      "esri/map",

      "esri/layers/FeatureLayer",

      "esri/symbols/SimpleFillSymbol",

The javascript loaded with this script contains the Dojo toolkit code as well.

Not sure how this works locally without this script reference.

Hope this helps,

Owen

Spatial XP

View solution in original post

2 Replies
OwenEarley
Occasional Contributor III

Your page does not seem to be loading the ESRI JS API:

// Reference the ESRI JS API (add the next line before creating a map)

<script src="http://js.arcgis.com/3.9/"></script>

<script>

    var map;

   

    require([

      "esri/InfoTemplate",

      "esri/map",

      "esri/layers/FeatureLayer",

      "esri/symbols/SimpleFillSymbol",

The javascript loaded with this script contains the Dojo toolkit code as well.

Not sure how this works locally without this script reference.

Hope this helps,

Owen

Spatial XP

asinha_ppc
New Contributor II

That did it! Thanks!!

0 Kudos