Dojo looking for package in wrong place
Closed this issue · 1 comments
I configured dojo like so(copied from your index file)
var dojoConfig = {
parseOnLoad: false,
async: true,
tlmSiblingOfDojo: false,
packages: [{
name: "ncam",
location: location.pathname.replace(/\/[^/]+$/, '') + "ncam"
}]
};
</script>
But I keep getting an error that it is looking for the package within the ESRI source file. The error looks like this:
GET http://js.arcgis.com/3.16/ncam/DirectionalLineSymbol.js
src: dojoLoader
info: ["http://js.arcgis.com/3.16/ncam/DirectionalLineSymbol.js", Event]
How do I config so it isn't looking there. BTW I am using angular
and angular-esri-map
, but don't think that is what the cause is.
Hey @Nick-t-go - yeah I've had this issue before as well.
All you need to do is make sure that your dojo config script is before the script reference to the arcgis api.
So like below:
<script>
var dojoConfig = {
parseOnLoad: false,
async: true,
tlmSiblingOfDojo: false,
packages: [{
name: "ncam",
location: location.pathname.replace(/\/[^/]+$/, '') + "ncam"
}]
};
</script>
<script src="http://js.arcgis.com/3.14/"></script>
I'm not an expert on the dojo loader (or amd loading in general) but I assume the reason it has to be in this order is so that when the arcgis api calls the loader, it already has package definition declared, so knows where to look when it encounters that module name.
Let me know if that works.