map-promisified
map-promisified copied to clipboard
Npm package need update, which don't have esm format
Hi there,
Running the library in Vue3 I get : Uncaught SyntaxError: The requested module '/node_modules/map-promisified/dist/mapPromisify.js?v=ef5eaebc' does not provide an export named 'default'
<template>
<div id="mapMain" ref="mapContainer" class="absolute top-0 bottom-0 left-0 right-0">
<MglMap :accessToken="accessToken" />
</div>
<!-- <router-view /> -->
</template>
<script lang="ts">
import { computed, defineComponent, onMounted, reactive, ref } from "vue";
import Mapbox from "mapbox-gl";
import { MglMap } from "vue-mapbox";
export default defineComponent({
components: { MglMap },
setup() {
const mapContainer = ref();
const mapbox = ref(null);
let accessToken = "pk.eyJ1IjoidHJvb3AiLCJhIjoiY2txdXNrcnMyMDducTJucnk4dmE0d2V1byJ9.CpmXTiNQDQGPzqQ6K2SfwQ";
onMounted(() => {
mapbox.value = Mapbox;
});
return { mapContainer, accessToken, mapbox };
},
});
</script>
Your assistance is appreciated :)
Same here, how can we workaround this?
Using it with vite and Vue3
Ok, in my case I "fixed" it by putting this into vite.config.js
export default defineConfig({
define: { "process.env": {} },
plugins: [vue()],
// added this -->
optimizeDeps: {
include: ['map-promisified']
},
// <-- added this
}