Skip to content
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

Inconsistent File Handling Between Development and Build Processes #10459

Open
4 of 7 tasks
arbcar opened this issue Aug 30, 2024 · 3 comments
Open
4 of 7 tasks

Inconsistent File Handling Between Development and Build Processes #10459

arbcar opened this issue Aug 30, 2024 · 3 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution status: needs more information There is not enough information to take action on the issue.

Comments

@arbcar
Copy link

arbcar commented Aug 30, 2024

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • 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.
  • 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.
@arbcar arbcar added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Aug 30, 2024
@OzakIOne
Copy link
Contributor

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

@OzakIOne OzakIOne removed bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Aug 30, 2024
@Josh-Cena
Copy link
Collaborator

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?

@Josh-Cena Josh-Cena added bug An error in the Docusaurus core causing instability or issues with its execution status: needs more information There is not enough information to take action on the issue. labels Aug 30, 2024
@arbcar
Copy link
Author

arbcar commented Aug 31, 2024

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

and there is a page that uses this file :

<iframe
src="/output/server.html"
style={{
flex: 1,
border: 'none',
width: '100%'
}}
/>

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

The file is accessible when i run for the first time 'docusaurus start' but once i ran 'docusaurus build && docusaurus serve' the file is not more accessible for 'docusarus start'.

If i open the resource directly : http://localhost:3000/output/server.html the resource is always available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution status: needs more information There is not enough information to take action on the issue.
Projects
None yet
Development

No branches or pull requests

3 participants