I'm trying to set up a simple template using codesandbox to be able to spin up arcgis js api maps quickly. I dont like codepen as much as codesandbox. I'd like to do it with the newer es6 module imports. I added @Anonymous User/core to the dependencies, and in my js file I have this:
import Map from "@arcgis/core/Map";
import MapView from "@arcgis/core/views/MapView";
import "@arcgis/core/assets/esri/themes/dark/main.css";
const map = new Map({
basemap: "dark-grey"
});
const view = new MapView({
map,
container: "viewDiv",
zoom: 4,
center: [15, 65]
});
Unfortunately I'm getting the error:
Solved! Go to Solution.
Currently, no. There is no fix.
But, based on this comment here, this will work in an upcoming release of Parcel, so eventually should work in codesandbox down the road.
I can confirm that by using the @parcel/bundler-experimental and versions of @parcel/core and parcel mentioned on the GitHub issue, I was able to generate a build in parcel.js using ESM modules and JS API.