{"action":"created","issue":{"url":"https://api.github.com/repos/angular/material2/issues/2171","repository_url":"https://api.github.com/repos/angular/material2","labels_url":"https://api.github.com/repos/angular/material2/issues/2171/labels{/name}","comments_url":"https://api.github.com/repos/angular/material2/issues/2171/comments","events_url":"https://api.github.com/repos/angular/material2/issues/2171/events","html_url":"https://github.com/angular/material2/issues/2171","id":194828819,"number":2171,"title":"hasV8BreakIterator breaks in environments without window (such as universal rendering)","user":{"login":"timvdalen","id":1038428,"avatar_url":"https://avatars.githubusercontent.com/u/1038428?v=3","gravatar_id":"","url":"https://api.github.com/users/timvdalen","html_url":"https://github.com/timvdalen","followers_url":"https://api.github.com/users/timvdalen/followers","following_url":"https://api.github.com/users/timvdalen/following{/other_user}","gists_url":"https://api.github.com/users/timvdalen/gists{/gist_id}","starred_url":"https://api.github.com/users/timvdalen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timvdalen/subscriptions","organizations_url":"https://api.github.com/users/timvdalen/orgs","repos_url":"https://api.github.com/users/timvdalen/repos","events_url":"https://api.github.com/users/timvdalen/events{/privacy}","received_events_url":"https://api.github.com/users/timvdalen/received_events","type":"User","site_admin":false},"labels":[{"id":433951675,"url":"https://api.github.com/repos/angular/material2/labels/discussion","name":"discussion","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":{"login":"DevVersion","id":4987015,"avatar_url":"https://avatars.githubusercontent.com/u/4987015?v=3","gravatar_id":"","url":"https://api.github.com/users/DevVersion","html_url":"https://github.com/DevVersion","followers_url":"https://api.github.com/users/DevVersion/followers","following_url":"https://api.github.com/users/DevVersion/following{/other_user}","gists_url":"https://api.github.com/users/DevVersion/gists{/gist_id}","starred_url":"https://api.github.com/users/DevVersion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DevVersion/subscriptions","organizations_url":"https://api.github.com/users/DevVersion/orgs","repos_url":"https://api.github.com/users/DevVersion/repos","events_url":"https://api.github.com/users/DevVersion/events{/privacy}","received_events_url":"https://api.github.com/users/DevVersion/received_events","type":"User","site_admin":false},"assignees":[{"login":"DevVersion","id":4987015,"avatar_url":"https://avatars.githubusercontent.com/u/4987015?v=3","gravatar_id":"","url":"https://api.github.com/users/DevVersion","html_url":"https://github.com/DevVersion","followers_url":"https://api.github.com/users/DevVersion/followers","following_url":"https://api.github.com/users/DevVersion/following{/other_user}","gists_url":"https://api.github.com/users/DevVersion/gists{/gist_id}","starred_url":"https://api.github.com/users/DevVersion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DevVersion/subscriptions","organizations_url":"https://api.github.com/users/DevVersion/orgs","repos_url":"https://api.github.com/users/DevVersion/repos","events_url":"https://api.github.com/users/DevVersion/events{/privacy}","received_events_url":"https://api.github.com/users/DevVersion/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2016-12-11T12:16:45Z","updated_at":"2016-12-12T08:09:45Z","closed_at":null,"body":"#### Bug, feature request, or proposal:\r\nBug: As of https://github.com/angular/material2/pull/1950, `@angular/material` no longer works with server-side rendering because https://github.com/angular/material2/commit/4b7e52d30aa342c3024ed078837a9bd4ca9e773b#diff-6d0e189ed8a75860045a39fe4c576374R7 expects window to be defined.\r\n\r\n#### What is the expected behavior?\r\nNo errors when loading the module\r\n\r\n#### What is the current behavior?\r\n```\r\nnode_modules\\@angular\\material\\material.umd.js:2028\r\nvar hasV8BreakIterator = (window.Intl && window.Intl.v8BreakIterator);\r\n                                     ^\r\n\r\nReferenceError: window is not defined\r\n```\r\n\r\n#### What are the steps to reproduce?\r\nLoading the module in a https://github.com/angular/universal project\r\n\r\n#### What is the use-case or motivation for changing an existing behavior?\r\nPR https://github.com/angular/material2/pull/1950 broke compatibility with node\r\n\r\n#### Which versions of Angular, Material, OS, browsers are affected?\r\nRunning on node\r\n\r\n#### Is there anything else we should know?\r\nAs a temporary fix, changing the line to `const hasV8BreakIterator = ((typeof window !== 'undefined') && window.Intl && (window.Intl as any).v8BreakIterator);` seems to work, but I'm not sure what that means for this platform check since node does have th v8 break iterator.\r\n\r\n\r\n/cc @sattip"},"comment":{"url":"https://api.github.com/repos/angular/material2/issues/comments/266366415","html_url":"https://github.com/angular/material2/issues/2171#issuecomment-266366415","issue_url":"https://api.github.com/repos/angular/material2/issues/2171","id":266366415,"user":{"login":"timvdalen","id":1038428,"avatar_url":"https://avatars.githubusercontent.com/u/1038428?v=3","gravatar_id":"","url":"https://api.github.com/users/timvdalen","html_url":"https://github.com/timvdalen","followers_url":"https://api.github.com/users/timvdalen/followers","following_url":"https://api.github.com/users/timvdalen/following{/other_user}","gists_url":"https://api.github.com/users/timvdalen/gists{/gist_id}","starred_url":"https://api.github.com/users/timvdalen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timvdalen/subscriptions","organizations_url":"https://api.github.com/users/timvdalen/orgs","repos_url":"https://api.github.com/users/timvdalen/repos","events_url":"https://api.github.com/users/timvdalen/events{/privacy}","received_events_url":"https://api.github.com/users/timvdalen/received_events","type":"User","site_admin":false},"created_at":"2016-12-12T08:09:45Z","updated_at":"2016-12-12T08:09:45Z","body":"Ah, we haven't run in to that since we're only using `MdDialog` and it's never rendered on the server side.\r\nFor our use case, `hasV8BreakIterator` is the only thing that's reached that expects a browser environment"}}
{"actor":{"display_login":"timvdalen"}}