Repository navigation
angular material breaks angular universal #883
Copy link
Copy link
Closed
Description
Bug, feature request, or proposal:
Bug
What is the expected behavior?
elements and content should be prerendered on server side
What is the current behavior?
Exceptions on server side,
ie:
EXCEPTION: ReferenceError: window is not defined
STACKTRACE:
ReferenceError: window is not defined
at [path_to_my_app]/node_modules/@angular2-material/tabs/tabs.js:109:13
at ZoneDelegate.invoke ([path_to_my_app]/node_modules/zone.js/dist/zone-node.js:281:29)
at Zone.run ([path_to_my_app]/node_modules/zone.js/dist/zone-node.js:174:44)
at NgZoneImpl.runOuter ([path_to_my_app]/node_modules/@angular/core/src/zone/ng_zone_impl.js:88:71)
at NgZone.runOutsideAngular ([path_to_my_app]/node_modules/@angular/core/src/zone/ng_zone.js:253:80)
at MdTabGroup.ngAfterViewChecked ([path_to_my_app]/node_modules/@angular2-material/tabs/tabs.js:108:20)
at AppView._View_ProductsSettingsComponent0.detectChangesInternal (ProductsSettingsComponent.template.js:151:46)
at AppView.detectChanges ([path_to_my_app]/node_modules/@angular/core/src/linker/view.js:243:14)
at AppView.detectViewChildrenChanges ([path_to_my_app]/node_modules/@angular/core/src/linker/view.js:269:19)
at AppView.detectChangesInternal ([path_to_my_app]/node_modules/@angular/core/src/linker/view.js:254:14)
Rendering Document Error: [TypeError: str.replace is not a function]
TypeError: str.replace is not a function
at escapeString ([path_to_my_app]/node_modules/parse5/lib/serialization/serializer.js:27:10)
at Serializer._serializeAttributes ([path_to_my_app]/node_modules/parse5/lib/serialization/serializer.js:124:55)
at Serializer._serializeElement ([path_to_my_app]/node_modules/parse5/lib/serialization/serializer.js:91:10)
at Serializer._serializeChildNodes ([path_to_my_app]/node_modules/parse5/lib/serialization/serializer.js:72:22)
at Serializer._serializeElement ([path_to_my_app]/node_modules/parse5/lib/serialization/serializer.js:114:14)
at Serializer._serializeChildNodes ([path_to_my_app]/node_modules/parse5/lib/serialization/serializer.js:72:22)
at Serializer._serializeElement ([path_to_my_app]/node_modules/parse5/lib/serialization/serializer.js:114:14)
at Serializer._serializeChildNodes ([path_to_my_app]/node_modules/parse5/lib/serialization/serializer.js:72:22)
at Serializer._serializeElement ([path_to_my_app]/node_modules/parse5/lib/serialization/serializer.js:114:14)
at Serializer._serializeChildNodes ([path_to_my_app]/node_modules/parse5/lib/serialization/serializer.js:72:22)
What are the steps to reproduce?
Try to use <md-tab>s or <md-input>
What is the use-case or motivation for changing an existing behavior?
Server side rendering
Which versions of Angular, Material, OS, browsers are affected?
"@angular/core": "2.0.0-rc.4",
"angular2-universal": "~0.104.5",
"@angular2-material/core": "^2.0.0-alpha.6",
node: v5.1.0 and v6.3.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
maciejtreder commentedon Jul 19, 2016
Interesting thing is, that few of material items, are rendering well. Ie:
md-sidenav
md-toolbar
md-icon
md-nav-list
quanterion commentedon Jul 19, 2016
duplicate of #774
cyrilletuzi commentedon Sep 17, 2016
See a temporary workaround here in #308
angular-automatic-lock-bot commentedon Sep 5, 2019
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.