facebook / docusaurus

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

Inconsistent File Handling Between Development and Build Processes #10459

Open arbcar opened 3 months ago

arbcar commented 3 months ago

Have you read the Contributing Guidelines on issues?

Prerequisites

Description

We're experiencing inconsistent behavior with file handling between our development and build processes. Specifically, a file placed in the static/apiHtmlOutput/ directory is not consistently accessible across different build and start commands.

Reproducible demo

No response

Steps to reproduce

1) Create a file to static/apiHtmlOutput/nextPosServer.html 2) Run yarn start - The file is accessible (working as expected) 3) Run yarn build && yarn serve- The file is accessible (working as expected) 4) Run yarn start again - The file is not found (unexpected behavior) 5) Rename the file during the dev process - The file becomes accessible again

Expected behavior

The file should be consistently accessible across all build and start processes, without needing to move it during development.

Actual behavior

The file is only consistently accessible after a build process or when moved during development. Running yarn start alone after step yarn serve fails to locate the file.

Your environment

Self-service

OzakIOne commented 3 months ago

I've tried replicating your issue, the only thing I found is that if you have a file at /static/api/output.html docusaurus start you have to go to localhost:3000/api/output.htmlwhile docusaurus build goes to localhost:3000/api/output (it also redirects localhost:3000/api/output.html) and so localhost:3000/api/output does't work when using docusaurus start

Josh-Cena commented 3 months ago

This is not supposed to happen, and I suspect there's something else going on in the repro steps.

The expected behavior is that it should always show the Docusaurus 404 page if you are already on the site, because then navigation happens in SPA fashion, but should always navigate successfully if you open it in a new tab. Is that the correct behavior you observe?

arbcar commented 3 months ago

I have this file : static\output\server.html

and there is a page that uses this file :