'Docusaurus: npm run serve reloaded page not rendered
I have a docosaurus page running. It works fine. I use
'npm run build'
and
'npm run serve'
to deploy it. The app runs fine, but when I go to any page that is not on root and I refresh it, I get:
Index of build/ Quick Intro/ quick1.2/
instead of the rendered page.
Any idea what to do?
Solution 1:[1]
This appears to be a bug in old versions of Docusaurus v2. If you look at the screenshots in the following bug report and PR, they show the same "Index of build/..." page:
- Bug Report: https://github.com/facebook/docusaurus/issues/6699
- Fixed by PR: https://github.com/facebook/docusaurus/pull/6701
I had the same issue when using Docusaurus v2.0.0-beta.15 and upgrading to Docusaurus v2.0.0-beta.17 fixed it.
According to the CHANGELOG.md, it should also be fixed in v2.0.0-beta.16:
2.0.0-beta.16 (2022-02-25)
...
? Bug Fix
...
docusaurus
- #6701 fix(cli): disable directory listing in serve (@Josh-Cena)
Source: Docusaurus/CHANGELOG.md
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Alois Klink |
