-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
docusaurus start and docusaurus build && docusaurus serve have different routing rule about static folder #5633
Comments
This issue is very hard to understand for me, can you explain it more simply? Instead of written text, just give me an example: which request is routed to which static file with start/prod mode. A matrix with factual data would be way easier to understand for me. Is this issue a duplicate of #4971? Dev is using The way those servers behave may be slightly different and we may not have options to make them behave 100% in the same way, even if it would be ideal. |
I took a movies. These demo structure is located here. Dev mode dev-demo-min.movProd mode build-serve-demo-min.movEspecially we have trouble by disallowing directory name have "." string in production because we want to host our static html integrated by auto-generated by sphinx has including "." directory. Is the way to avoid this misrouting with directory "." included? |
In addition, when we use python -m http.server 8000 --directory ./static we get different result from above because it doesn't rewrite url and we usually prefer this behavior as default hosting static site. It is convenient if we switch the static directory configuration that disable rewriting for example.
As I see it, It is not because base directory may not be related to html file links relative path routing above shows. |
I read serve command's implements and I got that serve command is not necessary when we use build artifact as simple static site without backend router. So I found this issue is trivial when use alternative web server or hosting static site storage service instead of using In AdditionWe use |
Hi @tkow
I still think that we can keep this issue open because we should try to make the dev & build/serve similar if possible, but we may close later this issue as wontfix if it's not possible to do so |
Closing as wontfix, because we neither control the routing of |
🐛 Bug Report
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
If you use
docusaurus start
static folder routings areIf you use
docusaurus build and serve
static folder routings areAs I thought it, Docusaurus shouldn't rewrite url about static folder resources because its files are tended to be linked by idempotent routing rule and may not depend on hosting server rewriting rule as default.
Have you read the [Contributing Guidelines on issues]
yes
Steps to reproduce
To reproduce, we need build step so I made repository for this because I can't find the way to do using sanbox.
Demo: https://github.com/tkow/docusaurus-url-denied-demo
npm install
npm run start
and accesslocalhost:3000/html
in browserdocusaurus build and docusaurus serve
and check mismatching between the results of navigating and showing messages by clicking links.npm run build && npm run serve
and accesslocalhost:3000/html
in browserdocusaurus build and docusaurus serve
and check matching between the results of navigating and showing messages by clicking links.Expected behavior
We have same routings between
docsaurus start
anddocsaurus build and docsaurus serve
.And static route should not be applied rewrite rules as default.
Actual behavior
We have different routings result between
docsaurus start
anddocsaurus build and docsaurus serve
.Your environment
Reproducible demo
https://github.com/tkow/docusaurus-url-denied-demo
The text was updated successfully, but these errors were encountered: