AlexLavoie42 / Nuxt-Mapbox

Elegant Mapbox integration with Nuxt
81 stars 11 forks source link

Wrong map style #17

Closed szulcus closed 1 year ago

szulcus commented 1 year ago

Reproduction:

<MapboxMap
    map-id="mapId"
    :options="{
        style: 'mapbox://styles/mapbox/satellite-v9',
        center: [props.origin.coordinates.lng, props.origin.coordinates.lat],
        zoom: 11
    }"
/>

All works fine in dev mode, but in production https://<domain>/api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v5.0.0/mapbox-gl-geocoder.css is loaded instead of https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v5.0.0/mapbox-gl-geocoder.css

AlexLavoie42 commented 1 year ago

I believe this is just from a silly typo in the style import. Should be fixed with 1.3.2

Leaving the issue open for now in case it still persists

szulcus commented 1 year ago

I'm not sure if it's the fault of this typo, because from what I can see the url in the head of the page is correct, but I can check it 🤔. I noticed that with the "original" mapbox-gl I get the same error. Is version 1.3.2 already published?

image image

AlexLavoie42 commented 1 year ago

The typo is not in the domain itself, it was http:/ instead of http:// which I believe would cause this problem.

I published 1.3.2 but it hasn't shown up on npm yet for some reason

szulcus commented 1 year ago

@AlexLavoie42 It turned out that the problem was mainly with nuxt version 3.4.0 (it wasn't reading some baseUrl variable 🤷‍♂️). I updated to 3.4.2 and everything works fine now. Out of curiosity, I also tried your module version 1.3.1 and it also works 😁.