question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Initial page shows before rendering internal pages directly

See original GitHub issue

Hi. Trying Scully with an Angular 11 app (this also happened before updating Angular version). Defined my initial page / to be rendered. As the app has many other internal pages defined in the angular-routing files the issue happens when navigating directly to any other internal page, different from the initial page. The initial page gets rendered and it’s visible for a few seconds before rendering the internal page.

I can suppose that the reason for this is that the generated index.html has the initial page fully rendered and also includes a placeholder for the typical router-outlet, so internal pages will forcefully pass through the initial page. Tried with initialNavigation: 'enabled', on the app-routing.module file without any results. Also tried detaching the initial page from the DOM by wrapping it on a named div, and reattaching it when the route === initial_page ; same problem.

A workaround for this would be nice, as generating static pages for all internal pages is not an option. Regards.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
SanderEliascommented, Nov 23, 2020

You should have the "internal’ routes redirected to 404.html which is the original index.html that is not pre-rendered. Again, this is a setting you should arrange for on your server. Not something Scully can provide much help in. If you use the original HTML, there will be not Scully pre-rendered content in there at all.

0reactions
SanderEliascommented, Dec 23, 2020

I’m going to close this, as this is not something Scully can solve. It needs to be solved using the server’s redirect rules. Just as for all static site hostings.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Basic Features: Pages - Next.js
Pre -rendering ... By default, Next.js pre-renders every page. This means that Next.js generates HTML for each page in advance, instead of having...
Read more >
React-router URLs don't work when refreshing or writing ...
The historyApiFallback is what fixed this issue for me. Now routing works correctly and I can refresh the page or type in the...
Read more >
Client-side vs. Server-side vs. Pre-rendering for Web Apps
Pre -rendering is a tradeoff between client-side and server-side rendering. Every pre-rendered page displays a skeleton template while the data waits to be ......
Read more >
How To Handle Routing in React Apps with React Router
Next, import Manatee and render inside the <div> . This will serve as a placeholder until you add more routes:.
Read more >
How the browser renders a web page? — DOM, CSSOM, and ...
The browser blocks some rendering of a webpage until certain resources are loaded first while other resources are loaded asynchronously.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found