Closed pjarnfelt closed 1 year ago
I am facing a similar issue as well. I am able to get this code to work in the Svelte Repl but not within my own Sveltekit project. I am receiving the same error as above even after creating my Sveltekit project with no typescript.
<script>
import { Map, Marker } from '@beyonk/svelte-mapbox'
let mapComponent
function onReady() {
mapComponent.flyTo({center:[-80.1527281,39.7660152]})
}
</script>
<Map accessToken=""
style="mapbox://styles/mapbox/outdoors-v11"
bind:this={mapComponent}
on:ready={onReady}
>
<Marker lng=-80.1527281 lat=39.7660152 label="NYC" />
</Map>
I fixed this issue by importing @beyonk/svelte-mapbox/components
instead.
e.g.
import { Map, Marker } from '@beyonk/svelte-mapbox/components';
When using SvelteKit, then this eslinting error is shown.
does not help as there are no types defined in https://registry.npmjs.org/@types%2fbeyonk__svelte-mapbox