Can't load css file normally until save/refresh any one file after jekyll server starts

Hallo, dont know if anyone alse has been through this problem:
everytime after I start my jekyll server, the website cannot load the css file totally right.

Only after saving any one file, the server regenerate some files, and the website works normally.

btw, am using jekyll 4.0.0

Thks so much!

Can you check the DevTools panes to see if perhaps the CSS file gives an error initially?

Can you share your repo link so I can reproduce?

And share your build command. I assume you use the implied --watch command to rebuild on edit. Are you using the --livereload flag? That will refresh the browser when the build is done and perhaps the refresh happens before the CSS is ready?

If you are, you can try using a delay. Flags for jekyll serve from the help:

            --livereload-min-delay [SECONDS]  Minimum reload delay
            --livereload-max-delay [SECONDS]  Maximum reload delay

Hey Currin, thks for ur reply.

This my repo, and you can see here directly what it shows. There are no warnings from the DevTools but it do load the css uncorrectly.

I just use the command jekyll build to build the website.

Thks a lot.

Thanks. Oh I see it’s a remote build problem. Github pages uses Jekyll 3.8.5 so add that to your gemfile to simulate locally what Github does. May be unrelated by still work doing for consistency

I’ll check it out tomorrow