Open naveedahmed1 opened 7 years ago
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)
Thank you, it should at least render the app shell. Nothing is returned in markup from server.
Merged 5.0 into Master but left this one commented out (in app.server) for now, until we can figure out the root cause.
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
@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.
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): https://github.com/MarkPieszak/aspnetcore-angular2-universal/issues/555
This repo has everything you need for SSR. Have you pulled latest?
I tried adding
ServerTransferStateModule
andBrowserTransferStateModule
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.