I have been following this tutorial.
https://developers.arcgis.com/javascript/latest/search-for-an-address/
The search bar does not work
Javascript-API
require([
"esri/config",
"esri/Map",
"esri/views/MapView",
"esri/widgets/Search"
], function(esriConfig,Map, MapView, Search) {
esriConfig.apiKey = "YOUR_API_KEY";
const map = new Map({
basemap: "arcgis-imagery"
});
const view = new MapView({
container: "viewDiv",
map: map,
center: [-122.3321,47.6062],
zoom: 12
});
const search = new Search({ //Add Search widget
view: view,
includeDefaultSources: true,
locationEnabled: true,
});
view.ui.add(search, "top-right"); //Add to the map
});
HTML
{% load static%}
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>ArcGIS API for JavaScript Tutorials: Display a map</title>
<link rel="stylesheet" href="{% static '/css/map.css' %}">
</head>
<body>
<div id="viewDiv" class="viewDiv"></div>
</div>
<script src="{% static '/js/arc.js' %}"></script>
</body>
</html>