Closed stavalfi closed 5 years ago
Build is not broken. You are probably serving the build dir from wrong folder.
What command did you run to serve the build locally ? Send screencast ..
Will re-open if proven not working
@endiliey I opened the index.html with chrome..
Okay I get you now.
I'm also facing the same problem when using netlify. Why it doesn't work there. (I followed the steps in the toturial).
Try starting a local web server with python -m SimpleHTTPServer 8000
in the build
dir and go to http://localhost:8000/<baseUrl>
. You should see it.
@yangshun I it's working locally. But what should I do to make it work in Netlify? @endiliey
I'm seeing this as well. Any URL without a trailing slash redirects to localhost:8000
The navigation generates URLs without a trailing slash, which if copied and shared, will redirect to a localhost:8000 URL. In other words, the client side routing works, but the browser trying to load a URL directly doesn't.
e.g. https://mydocs.com/path/to/doc redirects to → http://localhost:8000/path/to/doc/
python -m SimpleHTTPServer 8000
I faced the same issue. and running an http server to access the build folder works. This extra step should be mentioned in the official documentation.
@LLejoly there's ongoing work to provide an official "docusaurus serve" command: https://github.com/facebook/docusaurus/issues/3062
This is a jamstack SPA project, not all http servers will work perfectly with it, so we'd rather recommend one.
🐛 Bug Report
(I did not change anything in the website/configurations)
Reproducible Demo
https://github.com/stavalfi/docusaurus-broken-build
nothing was changed in
siteConfig.js
.node v: v8.11.3 (later tested with 10.10.3 as well - same results). yarn v: 1.16.0 mac v: mojave 10.14.3