I have created an application based upon the ArcGIS Javascript API 4.9 Webpack demo application (https://github.com/Esri/jsapi-resources/tree/master/4.x/webpack). The application is written in Typescript and is structured in the same manner as the demo. It cur...
I've tried adding the call to the demo/src/data/app.ts file:
import esri = __esri;
import urlUtils from "esri/core/urlUtils";
import MapImageLayer from "esri/layers/MapImageLayer";
...
urlUtils.addProxyRule({
urlPrefix: "my.server.com",
proxyUrl: "https://path.to.proxy/proxy.ashx"
});
I've also tried adding the call to the demo/src/widgets/App.tsx file:
import esri = __esri;
import urlUtils from "esri/core/urlUtils";
...
private onAfterCreate(element: HTMLDivElement){
urlUtils.addProxyRule({
urlPrefix: "my.server.com",
proxyUrl: "https://path.to.proxy/proxy.ashx"
});
import("./../data/app).then(...)
}
In both instances, the application fails on the urlUtils.addProxyRule call:
Uncaught TypeError: Cannot read property 'addProxyRule' of undefined
I have coded a number of applications in the JSAPI 3.x and 4.x, but this is my first using Typescript and Webpack, so I'm at a bit of a loss as to the error. Any assistance or guidance would be greatly appreciated. Thanks!