Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upReferenceError: window is not defined for https://angular.ganatan.com/leaflet #3
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had problems with leaflet module to build correctly in SSR. Apparently, you had too.
ReferenceError: window is not definedwindow 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
globalvariable 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?