Title: ReferenceError: window is not defined for https://angular.ganatan.com/leaflet · Issue #3 · ganatan/angular-node-java · GitHub
Open Graph Title: ReferenceError: window is not defined for https://angular.ganatan.com/leaflet · Issue #3 · ganatan/angular-node-java
X Title: ReferenceError: window is not defined for https://angular.ganatan.com/leaflet · Issue #3 · ganatan/angular-node-java
Description: 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 = windo...
Open Graph Description: 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 d...
X Description: 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 functio...
Opengraph URL: https://github.com/ganatan/angular-node-java/issues/3
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ReferenceError: window is not defined for https://angular.ganatan.com/leaflet","articleBody":"I had problems with leaflet module to build correctly in SSR. Apparently, you had too.\r\n\r\n`ReferenceError: window is not defined`\r\n\r\nwindow isn't here in SSR, but leaflet try to implements some functions directly in source.\r\n```\r\nvar requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame') || timeoutDefer;\r\nvar cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') ||\r\n\t\tgetPrefixed('CancelRequestAnimationFrame') || function (id) { window.clearTimeout(id); }; \r\n```\r\n\r\nI followed https://github.com/Angular-RU/angular-universal-starter/blob/master/server.ts.\r\nThey had `global` variable for mock every missing browser global variables.\r\n\r\nI try to add L global from custom leaflet.js where i modify some functions\r\n\r\nserver.ts\r\n```\r\nconst domino = require('domino');\r\n\r\nconst template = readFileSync(join('.', 'dist', 'index.html')).toString();\r\n\r\n// for mock global window by domino\r\n\r\nconst win = domino.createWindow(template);\r\n\r\nglobal['window'] = win;\r\n\r\nglobal['L'] = L;\r\n```\r\n\r\nBut i had always the same issue window isn't defined because LeafletModule import L from leaflet \r\n`import * as L from 'leaflet';`\r\n\r\nHow would you proceed to clean this leaflet?","author":{"url":"https://github.com/RomainMarecat","@type":"Person","name":"RomainMarecat"},"datePublished":"2020-03-05T10:04:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/3/angular-node-java/issues/3"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:85937ce4-0fe9-24e9-cfdb-2ba3a039407b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A50E:3EB376:17ED4A:2050FC:6A615CC5 |
| html-safe-nonce | 56727e62f047381dd7ed35384a135d6e5bfeaa8c7e31c7b543d4e7477bcfecda |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTBFOjNFQjM3NjoxN0VENEE6MjA1MEZDOjZBNjE1Q0M1IiwidmlzaXRvcl9pZCI6IjE1MDIxMTE3NzUwMDk2MjczMzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 76d8d3fde3e3c372411ea20ba732483871792d246320208204f6be58e7b98503 |
| hovercard-subject-tag | issue:576133096 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ganatan/angular-node-java/3/issue_layout |
| twitter:image | https://opengraph.githubassets.com/46c737f18cef7e8da2d1e69cf8d6b0e808bd7793ed3fd057dd6ebd4af4fe142e/ganatan/angular-node-java/issues/3 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/46c737f18cef7e8da2d1e69cf8d6b0e808bd7793ed3fd057dd6ebd4af4fe142e/ganatan/angular-node-java/issues/3 |
| og:image:alt | 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 d... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | RomainMarecat |
| hostname | github.com |
| expected-hostname | github.com |
| None | c258d2b06b498220e3b94af28b26bbbf58f4203a6373725f779afcc867afd263 |
| turbo-cache-control | no-preview |
| go-import | github.com/ganatan/angular-node-java git https://github.com/ganatan/angular-node-java.git |
| octolytics-dimension-user_id | 32958393 |
| octolytics-dimension-user_login | ganatan |
| octolytics-dimension-repository_id | 159201496 |
| octolytics-dimension-repository_nwo | ganatan/angular-node-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 159201496 |
| octolytics-dimension-repository_network_root_nwo | ganatan/angular-node-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bae60047c72c7890f36d34d78461f3453c546ee2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width