Docusaurus: bug (v2) html files with underscore prefix returning 404

Created on 26 Feb 2020  Ā·  7Comments  Ā·  Source: facebook/docusaurus

šŸ› Bug Report

HTML files in static dir with underscore prefix are not resolved. Page shows Page Not Found. Only resolves underscores when running docusaurus start.

Screen Shot 2020-02-26 at 11 14 25 AM

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

  1. Create a new project with docusaurus
  2. add _foo.html to static dir
  3. publish to github pages

Expected behavior

_foo.html page should be resolved. Behavior should be consistent between dev and prod builds.

Actual Behavior

_foo.html page shows Page Not Found

Screen Shot 2020-02-26 at 11 14 25 AM

Your Environment

  • Docusaurus version used: latest v2
  • Environment name and version consistent across all browsers, node 13.2.0
  • Operating system and version (desktop or mobile): macOS desktop

Reproducible Demo

https://github.com/amilajack/my-website

this works
https://github.com/amilajack/my-website/foo.html

this does not work
https://github.com/amilajack/my-website/_foo.html

bug needs triage

Most helpful comment

This is interesting! While it's not a Docusaurus bug, I recommend we document these weird behaviors down in a new FAQ page or something - maybe https://v2.docusaurus.io/docs/faq? I can think of more stuff to add into it (e.g. some prerendering-related issues).

@amilajack would you be interested in creating one?

Even if we don't add it as an FAQ page on our site, we can create a Stack Overflow question so that the knowledge is shared and people can discover it easily.

All 7 comments

This is not a Docusaurus bug, if you add the .nojekyll file to the gh-pages branch, this error will disappear.

See:

@lex111 thanks! Also do you think docusarus should add the .nojekyll file by default?

@amilajack no, I don’t think so, because this is an issue that applies only to GitHub Pages (in this case), and we should not care about this, since our task as a static site generator is to generate the proper build of website.

This is interesting! While it's not a Docusaurus bug, I recommend we document these weird behaviors down in a new FAQ page or something - maybe https://v2.docusaurus.io/docs/faq? I can think of more stuff to add into it (e.g. some prerendering-related issues).

@amilajack would you be interested in creating one?

Even if we don't add it as an FAQ page on our site, we can create a Stack Overflow question so that the knowledge is shared and people can discover it easily.

I’d love to document this. I was wondering what the correct place to document this was. I was thinking of adding it to the ā€œpublishing with GitHub pagesā€ section. What are your recommendations?

I like this idea, it will be more convenient and predictable for users than creating a separate section (FAQs) for this. Although maybe in the future it might be worth writing something like that.

Adding it to the "Publishing with GitHub pages" section sounds good!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MoogyG picture MoogyG  Ā·  3Comments

philipmjohnson picture philipmjohnson  Ā·  3Comments

chandankumar4 picture chandankumar4  Ā·  3Comments

rickyvetter picture rickyvetter  Ā·  3Comments

NikitaIT picture NikitaIT  Ā·  3Comments