Content Appears Before Loader and CSS Loading on SharePoint Server 2019 Website

Arunachalam J 20 Reputation points

We have encountered an unusual glitch on our SharePoint Server 2019 website, where the content is rendering before the loader and CSS styles are fully loaded. This issue is impacting the user experience, as it leads to a momentary display of unstyled content, causing a visually disruptive experience for our users.

  1. Content Display Before Loader: Upon navigating to our SharePoint site, users are briefly presented with unstyled content before the loader is triggered.
  2. CSS Loading Delay: It appears that there is a delay in loading the CSS stylesheets, contributing to the unstyled presentation of the content during the initial page load.

See below for site glitchScreenshot (4)

CSS calling on the Website

public async onInit(): Promise<void> {
await this.getCustomStyleCSS();

public async getCustomStyleCSS() {
        let data = await this.GetCall(
            siteUrl  + "/CustomStyleLibrary/BootstrapAndJS/css/Style.css"
        if (data.length > 0) {
            customStyleCss = data;

Here's the used code for the loader.

import * as $ from 'jquery';
$(".spAppAndPropertyPanelContainer").css("display", "none");
$("#SuiteNavPlaceHolder").css("opacity", "0");
const loaderDiv = document.createElement("div");
loaderDiv.className= "amaf-loading";

let amafLoader = setInterval(() => {
     if ($('.custom-style-css-class').length == 0) {
          $("#SuiteNavPlaceHolder").css("opacity", "0");
          $(".spAppAndPropertyPanelContainer").css("display", "none");
     } else {
          $("#SuiteNavPlaceHolder").css("opacity", "1");
          $(".spAppAndPropertyPanelContainer").css("display", "flex");
}, 500);

Thanks in Advance to solving issue.

A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
8,606 questions
JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
756 questions
0 comments No comments
{count} votes