Angular 18 ,Bootstrap 5, Node.js, Express.js, CRUD, PWA, SSR, SEO, Lazy Loading, Examples Angular & React nrwl
647
stars
315
forks
source link
ReferenceError: window is not defined for https://angular.ganatan.com/leaflet #3
Open
RomainMarecat opened 4 years ago
I had problems with leaflet module to build correctly in SSR. Apparently, you had too.
ReferenceError: window is not defined
window isn't here in SSR, but leaflet try to implements some functions directly in source.
I followed https://github.com/Angular-RU/angular-universal-starter/blob/master/server.ts. They had
global
variable for mock every missing browser global variables.I try to add L global from custom leaflet.js where i modify some functions
server.ts
But i had always the same issue window isn't defined because LeafletModule import L from leaflet
import * as L from 'leaflet';
How would you proceed to clean this leaflet?