docusaurus icon indicating copy to clipboard operation
docusaurus copied to clipboard

Home page renders twice, one below the other.

Open akhlesh opened this issue 1 year ago • 2 comments

Have you read the Contributing Guidelines on issues?

Prerequisites

  • [X] I'm using the latest version of Docusaurus.
  • [X] I have tried the npm run clear or yarn clear command.
  • [X] I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • [X] I have tried creating a repro with https://new.docusaurus.io.
  • [ ] I have read the console error message carefully (if applicable).

Description

The home page renders twice, one below the other. This happens only when I use the absolute path for example - https://docusaurus.io/index.html. The search and theme change button becomes unresponsive for the page rendered on top. This happens on the initial load only.

Reproducible demo

No response

Steps to reproduce

Check this URL - https://docusaurus.io/index.html

Expected behavior

The home page should render the content once.

Actual behavior

The home page renders content twice.

image

Your environment

  • Public source code:
  • Public site URL:
  • Docusaurus version used: 3.2.1
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): 18.13.0
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Windows 10

Self-service

  • [ ] I'd be willing to fix this bug myself.

akhlesh avatar Apr 18 '24 08:04 akhlesh

Thanks, this has been reported multiple times before and is not really a bug because the page should not be accessed through that URL but through its canonical variant, and your host can be configured to do a server redirect.

However this has been reported quite often in the past and I agree it's confusing and we should try to fix it:

  • https://github.com/facebook/docusaurus/issues/9916
  • https://github.com/facebook/docusaurus/issues/9552

I have a working solution (https://github.com/facebook/docusaurus/pull/10059) but I'll delay merging this to Docusaurus v4

slorber avatar Apr 19 '24 08:04 slorber