Hello,
I am currently developing a custom widget with the 4.21 JavaScript API with TypeScript. I am having an issue importing it into the _Layout.cshtml of my .NET Application. I put the widget directory within the custom script directory of my .NET app and compiled it according to the instructions, however, my application cannot find the script at runtime which crashes all the ESRI components of my app. Here is my index.html within the widget directory.
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />
<title>Routing Widget</title>
<script>
let locationPath = location.pathname.replace(/\/[^\/]+$/, "");
window.dojoConfig = {
packages: [
{
name: "app",
location: locationPath + "/app"
}
]
};
</script>
<script>
require(["app/RoutingWidget"]), function (RoutingWidget) {
console.log("This is a test: ", RoutingWidget.testProp)
};
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>