Skip to content

Issues in angular-5.0-updates repo when using ServerTransferStateModule from angular/platform-server #448

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

Open
naveedahmed1 opened this issue Oct 23, 2017 · 7 comments

Comments

@naveedahmed1
Copy link

I tried adding ServerTransferStateModule and BrowserTransferStateModule from @angular/platform-server' and @angular/platform-browser respectively.

As suggested https://next.angular.io/api/platform-server/ServerTransferStateModule and https://medium.com/@evertonrobertoauler/angular-5-universal-with-transfer-state-using-angular-cli-19fe1e1d352c

But after this change, I am now receiving error Error: The selector "app-root" did not match any elements and no markup is generated at server.

Any help and guidance would be highly appreciated.

@MarkPieszak
Copy link
Member

I'll take a look! It's something in the timing of how/when it's serializing the data (or where we need to be grabbing it from, that's different in the aspnet use-case)

@naveedahmed1
Copy link
Author

Thank you, it should at least render the app shell. Nothing is returned in markup from server.

@MarkPieszak
Copy link
Member

Merged 5.0 into Master but left this one commented out (in app.server) for now, until we can figure out the root cause.

@isaacrlevin
Copy link
Contributor

I think your issue is around your component. What is your selector in app.component.ts? It should be app-root. Also what is the selector in boot.server.ts, should be

@naveedahmed1
Copy link
Author

@isaac2004 no its not an issue of selector, I have confirmed it. The issue is no markup is generated at server, i.e. server doesn't get any response from node, hence it doesn't write anything to View as a result there isn't any app root tag in markup returned from server and when angular app initializes on client side it throws this error. I think @MarkPieszak has the idea about the issue. Its something related to asp.net engine.

@riiight
Copy link

riiight commented May 3, 2018

Is there any update or workaround for this? This is preventing us from being able to use SSR.

EDIT: It looks like this may be fixed now if you update your code (though I haven't tried it yet): #555

@isaacrlevin
Copy link
Contributor

This repo has everything you need for SSR. Have you pulled latest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants