Skip to content
This repository was archived by the owner on Jan 27, 2023. It is now read-only.
This repository was 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

@isuke01

Description

@isuke01

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions