title: Why is my `client-only` component in nuxt complaining that `window is not defined`?
body: <p>I have Vue SPA that I'm trying to migrate to nuxt. I am using <code>vue2leaflet</code> in a component that I enclosed in <code>&lt;client-only&gt;</code> tags but still getting an error from nuxt saying that <code>window is not defined</code>.</p>
  <p>I know I could use <code>nuxt-leaflet</code> or create a plugin but that increases the vendor bundle dramatically and I don't want that. I want to import the leaflet plugin only for the components that need it. Any way to do this?</p>
  <pre class="lang-html prettyprint-override"><code>&lt;client-only&gt;
     &lt;map&gt;&lt;/map&gt;
  &lt;/client-only&gt;
  </code></pre>
  <p>And the <code>map</code> component:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;template&gt;
    &lt;div id=&quot;map-container&quot;&gt;
      &lt;l-map
        style=&quot;height: 80%; width: 100%&quot;
        :zoom=&quot;zoom&quot;
        :center=&quot;center&quot;
        @update:zoom=&quot;zoomUpdated&quot;
        @update:center=&quot;centerUpdated&quot;
        @update:bounds=&quot;boundsUpdated&quot;
      &gt;
        &lt;l-tile-layer :url=&quot;url&quot;&gt;&lt;/l-tile-layer&gt;
      &lt;/l-map&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  import {
    LMap,
    LTileLayer,
    LMarker,
    LFeatureGroup,
    LGeoJson,
    LPolyline,
    LPolygon,
    LControlScale
  } from 'vue2-leaflet';
  import { Icon } from 'leaflet';
  import 'leaflet/dist/leaflet.css';
  
  // this part resolve an issue where the markers would not appear
  delete Icon.Default.prototype._getIconUrl;
  
  export default {
    name: 'map',
    components: {
      LMap,
      LTileLayer,
      LMarker,
      LFeatureGroup,
      LGeoJson,
      LPolyline,
      LPolygon,
      LControlScale
    },
  //...
  
  </code></pre>