We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
var requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame') || timeoutDefer; var cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') || getPrefixed('CancelRequestAnimationFrame') || function (id) { window.clearTimeout(id); };
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.
global
I try to add L global from custom leaflet.js where i modify some functions
server.ts
const domino = require('domino'); const template = readFileSync(join('.', 'dist', 'index.html')).toString(); // for mock global window by domino const win = domino.createWindow(template); global['window'] = win; global['L'] = L;
But i had always the same issue window isn't defined because LeafletModule import L from leaflet import * as L from 'leaflet';
import * as L from 'leaflet';
How would you proceed to clean this leaflet?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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?
The text was updated successfully, but these errors were encountered: