Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
CSS and JS files loading twice for preloaded assets in safari

I have an html page which is being served by my node server, the HTML string is generated on the server side and the js and css files are preloaded, attached code below. I see that in safari these assets are being loaded twice which causes a flash of unstyled content on my application page, what actually happens is due to this duplicate loading, the JS hydration and actions starts before CSS loads completely. Any help would help

NOTE: This happens only in safari

<!DOCTYPE html>
<html>

<head>
  <title>Page Title</title>

  <link rel="preload" as="script" href="/build/vendor.93cdba92ba41a9a0915e.js" />
  <link rel="preload" as="script" href="/build/main.dfb07bf2ef463aa43736.js" />

  <link rel="preload" href="/build/main.18.8f76beb6dd5628871221.css" as="style" onload="this.onload=null;this.rel='stylesheet'" />

  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1">
</head>

<body>
  <div style="z-index: 3" class="header" id="desktop-headerMount"> Header here</div>

  <div id="mountRoot" class="" style="min-height:1000px;margin-top:-2px;">
    // React App Will Mount Here
  </div>

  <div id="web-footerMount"> Footer Here </div>
  <script src="/build/vendor.93cdba92ba41a9a0915e.js"></script>
  <script src="/build/main.dfb07bf2ef463aa43736.js"></script>
</body>

</html>

Attaching a screen shot of the network tab too below, the css and js files are loaded twice.

This happens only in safari though, in Chrome it works fine

Network Tab Screenshot

Edit

I realise this at times depends on network speed, im wondering if some sort of race condition is happening, where before preload completes if my html parser reaches the script tag then this may happen i guess?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!