docusaurus: Css is not loading properly in build
🐛 Bug Report
I want to deploy the build folder, but the build folder css is all messed up. The pages has no styling. When I’m running in development mode the pages are loading fine, but in build mode, pages are not loading properly. Please see attached photos
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
- Clone the repo
git clone https://github.com/react-native-bootstrap/react-native-bootstrap - cd into website folder
cd website - Start development server and see website is working fine
yarn start - Not build the static website & open
index.htmlin build folderyarn build
Expected behavior
The website should have looked like this

Running index.html file from build folder should have worked fine, so that I can deploy it on github pages
Actual Behavior
Website looks like this after deploying build folder in gh-pages

Your Environment
- Docusaurus version used: 2.0.0-alpha.56
- Firefox 76.0.1 (64-bit)
- Node.js v10.15.3
- Operating system and version (desktop or mobile): Ubuntu 18.04
Reproducible Demo
The entire code is present here https://github.com/react-native-bootstrap/react-native-bootstrap/tree/master/website
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 34 (4 by maintainers)
You need a CNAME file as well in
staticwith the contentsreact-native-boostrap.io.This is not a Docusaurus problem, so I’m closing this.
Fixed it by setting this in the config:
Added some details regarding CSS not loading on Docosaurus 3.8 here.
Hi @sanjeevyadavIT ,
I have the same issue as you, Have you got any solution to it?
Also Just want to know, After running
yarn buildcan we run a static website through a browser without running any server?Today, I installed version 3.8.0 for the first time and encountered missing styles in Docusaurus on Windows 11. I needed to deploy this application on Windows Server 2019 IIS, where this issue persisted. Your solution restored the styles to working condition.
@AymaneHrouch can you please create a repro? If you have a
my-website/postcss.config.js, it’s quite hard for me to troubleshoot anything without seeing the whole setup. Your Docusaurs repro here doesn’t contain this file and doesn’t contain any reference to “private medical insurance” so I guess it’s not the repro that produced that error message. That’s probably a different issue. Can you create a new issue dedicated issue so that we can investigate that problem separately?Thanks @MohammadArk96. Can you just turn off CSS Cascade Layers and keep the former Node.js version?
For example use Node 22/24 with:
This problem looks related to using CSS Cascade Layers for Windows users. It’s not really the same issue as the original one (CSS is not loading), but rather a new issue (CSS is loading, but it doesn’t contain the expected CSS rules). This is probably related to posix paths vs Windows paths, I’ll look into it asap.
I had this issue fixed by setting v4 to false v4: false, // Improve compatibility with the upcoming Docusaurus v4
and downgrading nodejs to v20.14.0
i am facing this issue too with windows 11, can you tell me which css file is the problem? and where to find the correct one ?
@Cristy94 Thank you so much for sharing!!
I have the same problem, npm start shows correct css, on build it looks like this. There are no JS or network errors live.
Local:
Live: