0

i've been working on a ssr nuxt project n wanted to add nuxt-leaflet but apparently there's a window reference in nuxt-leaflet module that causes an (window not defined) error while server side rendering

1 Answers1

0

this is because nuxt-leaflet use window object, you should render your component on client-side

<client-side>
   <Component/>
</client-side>
Peter Csala
  • 17,736
  • 16
  • 35
  • 75
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 07 '22 at 12:06