i'm trying to import esri-loader into my nativescript vue app and show a simple map and am getting an error. below is my code
<script>
import * as esriLoader from 'esri-loader'
export default {
name: 'myMap',
mounted: function () {
esriLoader.loadModules(['esri/map'])
.then(([Map]) => {
// create map with the given options
const map = new Map(this.$refs.map, {
center: [-56.049, 38.485],
zoom: 3,
basemap: 'gray',
});
})
.catch(err => {
// handle any script or module loading errors
console.error(err);
});
}
}
</script>
and my error is below
JavaScript error:
file:///app/vendor.js:173:29: JS ERROR ReferenceError: Can't find variable: window
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript
encountered a fatal error: ReferenceError: Can't find variable: window
Has anyone successfully loaded esri-loader and a map in native script?