facebook / docusaurus

Easy to maintain open source documentation websites.
https://docusaurus.io
MIT License
55.96k stars 8.4k forks source link

Navbar logo and favicon images are not showing up while serving locally for sites with baseUrl #5863

Closed pranabdas closed 2 years ago

pranabdas commented 2 years ago

Have you read the Contributing Guidelines on issues?

Prerequisites

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

  1. Create a brand new site: npx @docusaurus/init@latest init my-site classic

  2. Set a baseUrl in docusaurus.config.js, say /test/

  3. Fire up npm start. This is what I see:

    Screenshot 2021-11-03 at 9 26 27 PM
  4. Visit http://localhost:3000/test/img/favicon.ico, it gives 404 error.

  5. However, npm run build followed by npm run serve correctly 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

Reproducible demo

No response

Self-service

slorber commented 2 years ago

please test the latest canary, does it work for you?

pranabdas commented 2 years ago

@slorber it's working alright now. Thank you.

honeytidy commented 2 years ago

@slorber it's working alright now. Thank you. How do you fix the problem? I have the same problem.

Josh-Cena commented 2 years ago

@honeytidy Please use the canary release: https://docusaurus.io/community/canary

Josh-Cena commented 2 years ago

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.8 or use the canary release.