Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation site does not load properly when baseUrl is "/" #7935

Closed
6 of 7 tasks
tony-b-4d opened this issue Aug 10, 2022 · 1 comment
Closed
6 of 7 tasks

Documentation site does not load properly when baseUrl is "/" #7935

tony-b-4d opened this issue Aug 10, 2022 · 1 comment
Labels
closed: question This issue is a user error/misunderstanding.

Comments

@tony-b-4d
Copy link

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn 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

Hi,

When baseUrl is set to "/", and I'm building the website on gh-pages, the CSS does not load properly and an error message suggests that I use /docs/ as baseURL.

Reproducible demo

No response

Steps to reproduce

This does not happen in a local environment.

See this commit for more details
doc4d/docs@aeb0799

Expected behavior

The site builds correctly

Actual behavior

The site displays an error message

error

I have to use /docs/ as baseURL to get the site to load properly, but I shouldn't have to (URLs become doc4d.github.io/docs/docs, not an efficient URL).

Your environment

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

Self-service

  • I'd be willing to fix this bug myself.
@tony-b-4d tony-b-4d added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Aug 10, 2022
@slorber
Copy link
Collaborator

slorber commented Aug 10, 2022

CleanShot 2022-08-10 at 12 18 34@2x

I have to use /docs/ as baseURL to get the site to load properly, but I shouldn't have to

Yes you should

The site is hosted on /docs/ baseurl, so as documented in the gitHub deployment doc, and as the error message suggest, you raally have to use that baseUrl in your site config.

(URLs become doc4d.github.io/docs/docs, not an efficient URL).

I don't know what you mean by "not efficient URL, but /docs/docs is a perfectly fine URL:

  • GitHub pages uses /repoName/ by default as a baseUrl (unless you use an organization): you can name your repo something else than "docs" if you want something else
  • Docusaurus docs use /docs/ as prefix for all docs, but you can rename or replace it by /

Note: In theory, /docs/docs is perfectly valid. In practice we have a bug with /docs/docs, and so you should avoid that, see #6294

I'd advise you to name your github repo something else than "docs", or using a better host like Vercel/Netlify.

@slorber slorber closed this as completed Aug 10, 2022
@Josh-Cena Josh-Cena closed this as not planned Won't fix, can't repro, duplicate, stale Aug 10, 2022
@Josh-Cena Josh-Cena added closed: question This issue is a user error/misunderstanding. and removed bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: question This issue is a user error/misunderstanding.
Projects
None yet
Development

No branches or pull requests

3 participants