facebook / facebook/docusaurus

Inconsistent File Handling Between Development and Build Processes

Open
#10,459 3 comments 0 reactions 0 assignees View on GitHub
bug status: needs more information
Dominant language
TypeScript
Stars
66.2k
Forks
10k
Avg merge
1d 3h
Merged PRs (30d)
52

Description

### Have you read the Contributing Guidelines on issues?

- [X] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#issues).

### Prerequisites

- [X] I'm using the latest version of Docusaurus.
- [X] I have tried the `npm run clear` or `yarn clear` command.
- [ ] I have tried `rm -rf node_modules yarn.lock package-lock.json` and re-installing packages.
- [ ] I have tried creating a repro with https://new.docusaurus.io.
- [X] I have read the console error message carefully (if applicable).

### 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

- Docusaurus version used: latest

### Self-service

- [ ] I'd be willing to fix this bug myself.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.