async data does not render on server
See original GitHub issueBug Report
What is the expected behavior?
Wait for all async calls (promises included) to resolve before rendering the page.
What is the current behavior?
The server doesn’t wait for the async promises to resolve before rendering
What modules are related to this issue?
- [ ] aspnetcore-engine
- [ ] common
- [ ] express-engine
- [ ] hapi-engine
- [ ] module-map-ngfactory-loader
Minimal reproduction with instructions:
please check this repo: https://github.com/GabrielCoriiu/universal-starter-contentful-async and this: https://github.com/angular/universal-starter/issues/181#issuecomment-412262601
What is the use-case or motivation for changing an existing behavior?
SEO
Environment:
@nguniversal versions
- aspnetcore-engine:
- common:
- express-engine:
- hapi-engine:
- module-map-ngfactory-loader:
<!--
Output from: `ng --version`.
If nothing, output from: `node --version` and `npm --version`.
Windows (7/8/10). Linux (incl. distribution). macOS (El Capitan? Sierra?)
-->
Is there anything else we should know?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
async data does not render on server · Issue #181 - GitHub
I actually do async requests to mongodb, and getting no data rendered on a server. So it does not solve the SEO of...
Read more >How To Handle Async Data Loading, Lazy Loading, and Code ...
Notice that the component renders before the data is loaded. The advantage with asynchronous code is that it won't block the initial render....
Read more >Server side rendering with async data fetch - Stack Overflow
We want to server side render our pages that should be filled by the data from our data sources. This transaction has to...
Read more >Resolving async state while server-rendering · Pullstate
hasAsyncStateToResolve () , which will return true unless there is no async state in our React tree to resolve. Inside this loop we...
Read more >React Frontload - David Nicholas Williams
Data loading is, of course, async. The client component-centric data loading pattern is nice, but it's incompatible with synchronous server render. React simply ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It is indeed the case that there was no transfer state between the server and the client. Now it works like a charm. I guess this can be closed. Thanks @Gorniv
contentfull don’t use TransferState for sync server and browser. Read how to work TransferState and look https://github.com/Angular-RU/angular-universal-starter/blob/master/src/app/transfer-back/transfer-back.component.ts