Getting esri.config.defaults.io.proxyUrl is not set error when running on IE9.
It does not happen with IE10, IE11, nor chrome.
It happens just before the authentication popup dialog should appear.
Full error:
Error: esri.config.defaults.io.proxyUrl is not set. If making a request to a CORS enabled server, please push the domain into esri.config.defaults.io.corsEnabledServers.
This is because IE9 doesn't support Cross-Origin Resource Sharing (CORS). You can see the support for CORS across various browsers here: http://caniuse.com/#feat=cors
To resolve this error you'll need to setup a proxy and and then set the proxy url in your application using esri.config.defaults.io.proxyUrl.
Details on how to install and setup the proxy can be found here: Esri/resource-proxy · GitHub
Set up proxy and using https:
Getting following error:
DOM7011: The code on this page disabled back and forward caching. For more information, see: http://go.microsoft.com/fwlink/?LinkID=291337
File: localhost:44300
HTML1300: Navigation occurred.
File: localhost:44300
SyntaxError: Invalid character
{
[functions]: ,
__proto__: {
[functions]: ,
__proto__: {
[functions]: ,
__proto__: { },
message: "",
name: "Error"
},
message: "",
name: "SyntaxError"
},
description: "Invalid character",
message: "Invalid character",
name: "SyntaxError",
number: -2146827274,
response: {
[functions]: ,
__proto__: { },
loaded: 4948,
options: {
[functions]: ,
__proto__: { },
data: null,
handleAs: "json",
method: "GET",
query: null,
sync: false
},
status: 404,
text: "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>IIS 8.0 Detailed Error - 404.0 - Not Found</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana,Arial,Helvetica,sans-serif;}
code{margin:0;color:#006600;font-size:1.1em;font-weight:bold;}
.config_source code{font-size:.8em;color:#000000;}
pre{margin:0;font-size:1.4em;word-wrap:break-word;}
ul,ol{margin:10px 0 10px 5px;}
ul.first,ol.first{margin-top:5px;}
fieldset{padding:0 15px 10px 15px;word-break:break-all;}
.summary-container fieldset{padding-bottom:5px;margin-top:4px;}
legend.no-expand-all{padding:2px 15px 4px 10px;margin:0 0 0 -12px;}
legend{color:#333333;;margin:4px 0 8px -12px;_margin-top:0px;
font-weight:bold;font-size:1em;}
a:link,a:visited{color:#007EFF;font-weight:bold;}
a:hover{text-decoration:none;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC000",
total: 4948,
url: "/cbtree/errors/CBTErrors.json",
xhr: { }
},
stack: "SyntaxError: Invalid character
at a.json (https://js.arcgis.com/3.12/init.js:242:173)
at n (https://js.arcgis.com/3.12/init.js:240:331)
at q (https://js.arcgis.com/3.12/init.js:160:111)
at f (https://js.arcgis.com/3.12/init.js:164:199)"
}
SEC7118: XMLHttpRequest for https://www.ocsdev.oceaneering.com/arcgis-proxy/proxy.jsp?https://www.arcgis.com/sharing/content/ite... required Cross Origin Resource Sharing (CORS).
File: localhost:44300
SEC7118: XMLHttpRequest for https://www.ocsdev.oceaneering.com/arcgis-proxy/proxy.jsp?https://www.arcgis.com/sharing/rest/portal... required Cross Origin Resource Sharing (CORS).
File: localhost:44300
SyntaxError: Invalid character
{
[functions]: ,
__proto__: { },
description: "Invalid character",
log: undefined,
message: "Invalid character",
name: "SyntaxError",
number: -2146827274,
stack: "SyntaxError: Invalid character
at b.fromJson (https://js.arcgis.com/3.12/init.js:230:409)
at b.contentHandlers.json (https://js.arcgis.com/3.12/init.js:187:383)
at s (https://js.arcgis.com/3.12/init.js:192:59)
at c (https://js.arcgis.com/3.12/init.js:76:215)
at d (https://js.arcgis.com/3.12/init.js:76:10)
at callback (https://js.arcgis.com/3.12/init.js:77:350)
at Anonymous function (https://js.arcgis.com/3.12/init.js:195:298)
at k (https://js.arcgis.com/3.12/init.js:199:425)
at m (https://js.arcgis.com/3.12/init.js:199:357)
at resolve (https://js.arcgis.com/3.12/init.js:201:441)"
}
SyntaxError: Invalid character
{
[functions]: ,
__proto__: { },
description: "Invalid character",
log: undefined,
message: "Invalid character",
name: "SyntaxError",
number: -2146827274,
stack: "SyntaxError: Invalid character
at b.fromJson (https://js.arcgis.com/3.12/init.js:230:409)
at b.contentHandlers.json (https://js.arcgis.com/3.12/init.js:187:383)
at s (https://js.arcgis.com/3.12/init.js:192:59)
at c (https://js.arcgis.com/3.12/init.js:76:215)
at d (https://js.arcgis.com/3.12/init.js:76:10)
at callback (https://js.arcgis.com/3.12/init.js:77:350)
at Anonymous function (https://js.arcgis.com/3.12/init.js:195:298)
at k (https://js.arcgis.com/3.12/init.js:199:425)
at m (https://js.arcgis.com/3.12/init.js:199:357)
at resolve (https://js.arcgis.com/3.12/init.js:201:441)"
}
Did you test the proxy as described in the instructions section of this doc? resource-proxy/README.md at master · Esri/resource-proxy · GitHub
Got proxy (.Net) version set up.
Added Access-Control-Allow-Origin, *
to the Http Response Headers for the proxy site.
Without it was getting Access-Control-Allow-Origin not found error for the webmap website that was calling the proxy web server.
But with the
Access-Control-Allow-Origin, *
getting a different set of errors:
Multiple Access-Control-Allow-Origin headers are not allowed for CORS response
Not defining Access-Control-Allow-Origin anywhere else in the webmap. What's the best way to remove these errors or setup the Access-Control-Allow-Origin on the proxy webserver to avoid either the Access-Control-Allow-Origin error or the Multiple Access-Control-Allow-Origin headers error?