Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Window is not defined. When ssr: set to true in nuxt.config #124

Open
isuke01 opened this issue May 31, 2022 · 0 comments
Open

Window is not defined. When ssr: set to true in nuxt.config #124

isuke01 opened this issue May 31, 2022 · 0 comments

Comments

@isuke01
Copy link

isuke01 commented May 31, 2022

Hi.

There is no problem if Nuxt is set as non SSR in nuxt.config.js - ssr: false
But I'm using Nuxt because I need SSR.

And sadly I see error Window is not defined. I have wrapped the map in <client-only> Also I wrapped whole component into <client-only> just in case. But this didn't help.

Basically If I'm not importing anything from vue2-leaflet (I'm using nuxt-leaflet pack but I have to import some stuff from vue2-leaflet) everything works.
But as soon as I do e.g in my component:
import { LWMSTileLayer } from "vue2-leaflet" I'm getting the Window error.

Edit:
Ofc I can do:
vue-leaflet/Vue2Leaflet#207 (comment)
But then what is the point of this module anyway?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant