Navbar logo and favicon images are not showing up while serving locally for sites with baseUrl
See original GitHub issueHave 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 clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand 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
After updating to docusarus beta 9, the navbar logo image (and favicon image) is not showing up while serving the site locally. This happens with sites having baseUrl (other than /). If I visit http://localhost:3000/{baseUrl}/img/favicon.ico, I see 404 Page Not Found. However, things seems alright while building the site.
Steps to reproduce
-
Create a brand new site:
npx @docusaurus/init@latest init my-site classic -
Set a
baseUrlindocusaurus.config.js, say/test/ -
Fire up
npm start. This is what I see:
-
Visit
http://localhost:3000/test/img/favicon.ico, it gives 404 error. -
However,
npm run buildfollowed bynpm run servecorrectly shows the logo.
Expected behavior
Should be able to see the logo and favicon images correctly while serving the site locally.
Actual behavior
Logo and favicon images are not available in website path.
Your environment
- Public source code: NA
- Public site URL: NA
- Docusaurus version used: 2.0.0-beta.9
- Environment name and version (e.g. Chrome 89, Node.js 16.4): Safari 15.1, Node.js 16.13.0
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): macOS 11.6.1
Reproducible demo
No response
Self-service
- I’d be willing to fix this bug myself.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:5 (1 by maintainers)

Top Related StackOverflow Question
Hi, due to the number of duplicate reports on this issue I’ve reopened the original one. This has already been fixed and will be released soon. If you are experiencing the same, please either stay on
beta.8or use the canary release.@honeytidy Please use the canary release: https://docusaurus.io/community/canary