-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Labels
needs: discussionFurther discussion with the team is needed before proceedingFurther discussion with the team is needed before proceeding
Description
Bug, feature request, or proposal:
Bug: As of #1950, @angular/material no longer works with server-side rendering because 4b7e52d#diff-6d0e189ed8a75860045a39fe4c576374R7 expects window to be defined.
What is the expected behavior?
No errors when loading the module
What is the current behavior?
node_modules\@angular\material\material.umd.js:2028
var hasV8BreakIterator = (window.Intl && window.Intl.v8BreakIterator);
^
ReferenceError: window is not defined
What are the steps to reproduce?
Loading the module in a https://github.com/angular/universal project
What is the use-case or motivation for changing an existing behavior?
PR #1950 broke compatibility with node
Which versions of Angular, Material, OS, browsers are affected?
Running on node
Is there anything else we should know?
As 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.
/cc @sattip
Splaktar
Metadata
Metadata
Assignees
Labels
needs: discussionFurther discussion with the team is needed before proceedingFurther discussion with the team is needed before proceeding