AlexLavoie42 / Nuxt-Mapbox

Elegant Mapbox integration with Nuxt
81 stars 11 forks source link

Empty canvas on production #57

Closed 0PandaDEV closed 1 year ago

0PandaDEV commented 1 year ago

I created a little project where a full screen map is displayed, but for some reason it's just blank on production. In the development environment it works perfectly, but not in production.

Also, how do I make the map 2D?

How it should look

image

How it looks in production

image

AlexLavoie42 commented 1 year ago

Please check your console for any errors or send a reproduction link. I cannot assist without further details

0PandaDEV commented 1 year ago

Oh, I see it now it says it requires an API access token for the Mapbox API, but I have set one directly in the code that's why I cannot give the code to you, so the token should be in the production build.

image

AlexLavoie42 commented 1 year ago

Unfortunately I can't provide much assistance without more details about your production build. Just make sure that your nuxt config is properly making it to your production build, and that your api key is is set correctly in nuxt.config.ts like so:

export default defineNuxtConfig({
  modules: [
    'nuxt-mapbox'
  ],
  mapbox: {
    accessToken: '{API_KEY}'
  }
})

As for making the map 2d, that is done through the maps style