I'm trying to migrate my existing SPA Vue app to NuxtJS framework to take benefits of SSR.
In my current app, I'm using the following directives to load my dependencies:
<script>
import L from 'leaflet';
import '@geoman-io/leaflet-geoman-free';
import 'leaflet.markercluster';
import { Tooltip, Carousel } from 'bootstrap';
import 'leaflet-fullscreen';
import 'leaflet-sidebar';
import 'leaflet.vectorgrid';
export default {
name: 'carte',
props: ['gps'],
components: {
GChart,
},
data() {
...
},
...
}
</script>
When loading the component, I get the "window is not defined" error from Nuxt.
Do you know how to get over this error? If possible, I don't want to load plugins globally because I need those modules only for that component.
Please note that I'm not using Nuxt-leaflet or Vue-leaflet as they do not work with Vue 3.
Thanks a lot!