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

angular material breaks angular universal #883

Closed
maciejtreder opened this issue Jul 19, 2016 · 4 comments
Closed

angular material breaks angular universal #883

maciejtreder opened this issue Jul 19, 2016 · 4 comments

Comments

@maciejtreder
Copy link

maciejtreder commented Jul 19, 2016

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

@maciejtreder
Copy link
Author

Interesting thing is, that few of material items, are rendering well. Ie:

md-sidenav
md-toolbar
md-icon
md-nav-list

@quanterion
Copy link
Contributor

duplicate of #774

@cyrilletuzi
Copy link
Contributor

See a temporary workaround here in #308

@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 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants