Skip to content
New issue

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

SSR is broken after update to 5.0.0-rc.2: "ReferenceError: window is not defined" #8809

Closed
alirezamirian opened this issue Dec 5, 2017 · 1 comment · Fixed by #8816
Closed
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@alirezamirian
Copy link

Bug:

SSR is broken after update from beta.8 to 5.0.0-rc.2. Full stack trace:

ReferenceError: window is not defined
at MatCommonModule._isTestEnv (D:\workspace\myket-website\dist\server\server.js:24593:16)
at MatCommonModule._areChecksEnabled (D:\workspace\myket-website\dist\server\server.js:24582:121)
at new MatCommonModule (D:\workspace\myket-website\dist\server\server.js:24567:18)
at createClass (D:\workspace\myket-website\dist\server\server.js:10892:20)
at createProviderInstance$1 (D:\workspace\myket-website\dist\server\server.js:10866:26)
at initNgModule (D:\workspace\myket-website\dist\server\server.js:10819:28)
at new NgModuleRef
(D:\workspace\myket-website\dist\server\server.js:12062:9)
at createNgModuleRef (D:\workspace\myket-website\dist\server\server.js:12052:12)
at Object.debugCreateNgModuleRef [as createNgModuleRef] (D:\workspace\myket-website\dist\server\server.js:14362:12)
at NgModuleFactory
.create (D:\workspace\myket-website\dist\server\server.js:15486:25)

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular CLI: 1.5.4
Node: 6.9.1
OS: win32 x64
Angular: 5.0.3
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router

@angular/cdk: 5.0.0-rc.2
@angular/cli: 1.5.4
@angular/flex-layout: 2.0.0-beta.10-4905443
@angular/language-service: 4.4.6
@angular/material: 5.0.0-rc.2
@angular-devkit/build-optimizer: 0.0.33
@angular-devkit/core: 0.0.21
@angular-devkit/schematics: 0.0.37
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.4
@schematics/angular: 0.1.7
typescript: 2.4.2
webpack: 3.8.1

Is there anything else we should know?

@devversion devversion self-assigned this Dec 5, 2017
devversion added a commit to devversion/material2 that referenced this issue Dec 5, 2017
* Currently if someone renders his Angular application using server side rendering, the `MatCommonModule` will throw an error due to missing `window` variable checks.

Fixes angular#8809
@devversion devversion added has pr P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Dec 5, 2017
mmalerba pushed a commit that referenced this issue Dec 8, 2017
* Currently if someone renders his Angular application using server side rendering, the `MatCommonModule` will throw an error due to missing `window` variable checks.

Fixes #8809
mmalerba pushed a commit that referenced this issue Dec 8, 2017
* Currently if someone renders his Angular application using server side rendering, the `MatCommonModule` will throw an error due to missing `window` variable checks.

Fixes #8809
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants