Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clear
oryarn clear
command. - I have tried
rm -rf node_modules yarn.lock package-lock.json
and re-installing packages. - I have tried creating a repro with https://new.docusaurus.io.
- I have read the console error message carefully (if applicable).
Description
Navigation to index.html
of any page on a clean docusaurus 3.0 installation behind webserver/loadbalancer renders the page twice (e.g. site.xy/index.html or site.xy/blog/index.html). Navigation to the folder url works as expected (e.g. site.xy or site.xy/blog)
I've experienced this issue behind an AWS NLB and was able to reproduce it with a clean docusaurus 3 installation on a local nginx webserver as well (see reproduce case below). We only experienced it after upgrading to 3.0 so I am assuming it's a 3.0 only issue.
The reproduce case is utilizing docker & docker-compose for this, but it should also work on any locally installed & configured webserver. The issue does NOT occur however on running a development server, neither does it occur wen using npm run build && npm run serve
Reproducible demo
No response
Steps to reproduce
- create fresh docusaurus installation through:
npx create-docusaurus@latest docusaurus-test classic --typescript
and change to installation dirdocusaurus-test
- run
npm run build
- create a basic
./default.conf
for nginx:
server {
listen 80;
listen [::]:80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
}
- create a basic
./docker-compose.yaml
service mounting the config and build:
version: '3'
services:
docs:
image: nginx:latest
container_name: docs
ports:
- "8080:80"
volumes:
- ./default.conf:/etc/nginx/conf.d/default.conf
- ./build:/usr/share/nginx/html
- run
docker-compose up
- navigate to
localhost:8080/index.html
orlocalhost:8080/blog/index.html
- scroll down to see that the whole page is rendered twice
Expected behavior
The page should only be rendered once
Actual behavior
Every page accessed directly through */index.html is rendered twice.
Browser console does not show any errors.
Your environment
- Docusaurus version used: 3.0.0 with react 18.2.0
- Environment name and version: Chrome 119.0.6045.124, Node.js 18.13
- Operating system and version: Ubuntu 20.04.6 LTS
Self-service
- I'd be willing to fix this bug myself.