after.js: Unloaded CSS on initial load causing non-styled site to be displayed momentarily.

Bug, Feature, or Question?

Bug.

Current Behavior

When the site is loaded, the site shows as unstyled momentarily, until the CSS is loaded in and all is fine. I have tested this in both development and production modes and although the โ€˜flickerโ€™ is quicker in production, it is still noticeable.

This is occurring with the code from blank setup of the project with no other changes to the setup.

Video demo of the problem attached:

9f3e4f746c648111c96a0c367d7eccf5

Desired Behavior

Website should load without CSS flicker and show a fully loaded site to the user.

Suggested Solutions

Additional Information

Code installed using create-after-app installation script and no other changes to the code have been made.


  • After.js Version: 0.8.2
  • Razzle Version: ^3.0.0
  • React Version: ^16.13.1
  • TypeScript Version:
  • OS: Mac OS Catalina
  • Node Version: 13.6
  • Package Manager and Version:
  • Demo Repo or Link:

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16

Most upvoted comments

@pixel-mattp letโ€™s do it right now ๐Ÿ˜ƒ

ok so before we go for the version 2 just use Google Page Insight to check your website performance and then after you switched to version 2 check again ๐Ÿ˜ƒ

we need to measure things and see if we are going forward or backward since this version focused on performance โ€ฆ

๐Ÿ˜„ I need some motivation ๐Ÿ˜ƒ can you guys give me possessive energy every day? In that case, I can finish #296 and we can release version 2

(if itโ€™s very urgent, I can help you to setup version 2. itโ€™s stable and tested on 5 sites)

Iโ€™d love to try version 2! This bug at the moment is the only reason why we cannot switch from using NextJS. AfterJS is much better so we are desperate to make the switch. ๐Ÿ˜ƒ