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

Development server broken on fresh install #7571

Closed
5 of 7 tasks
davidvarela-us opened this issue Jun 5, 2022 · 8 comments
Closed
5 of 7 tasks

Development server broken on fresh install #7571

davidvarela-us opened this issue Jun 5, 2022 · 8 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

@davidvarela-us
Copy link

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

npm run start is not serving files on a fresh install

Reproducible demo

No response

Steps to reproduce

  1. npx create-docusaurus@latest my-website classic --typescript
  2. cd my-website
  3. npm run start

Expected behavior

I expect to see some ouptut at localhost:3000.

Actual behavior

Navigating to localhost:3000 complains with "This site can’t be reached".

Must be some problem with the development stack itself: npm run build + npm run serve works as expected.

Your environment

  • node version: v18.3.0
  • npm version: 8.5.5
  • OS: archlinux

Self-service

  • I'd be willing to fix this bug myself.
@davidvarela-us davidvarela-us 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 Jun 5, 2022
@davidvarela-us davidvarela-us changed the title Development server broken on fresh install Development server broken on fresh install (typescript) Jun 5, 2022
@davidvarela-us davidvarela-us changed the title Development server broken on fresh install (typescript) Development server broken on fresh install Jun 5, 2022
@davidvarela-us
Copy link
Author

davidvarela-us commented Jun 5, 2022

Failing for both typescript and js versions. But both build/serve fine

@Josh-Cena Josh-Cena added status: needs more information There is not enough information to take action on the issue. and removed status: needs triage This issue has not been triaged by maintainers labels Jun 6, 2022
@Josh-Cena
Copy link
Collaborator

Interesting that build + serve works: that's a pretty critical piece of information. I still strongly suspect there's something going on with the system setup, but I don't know how to debug this. Leaving this open until someone can chime in.

Have you tried running start with --host 0.0.0.0 or --port 8888, etc.?

@davidvarela-us
Copy link
Author

The dev server seems to be running/watching at least:

✔ Client
  Compiled successfully in 1.20s

client (webpack 5.73.0) compiled successfully

✔ Client
  Compiled successfully in 1.03s

client (webpack 5.73.0) compiled successfully

✔ Client
  Compiled successfully in 514.34ms

client (webpack 5.73.0) compiled successfully`

@Josh-Cena
Copy link
Collaborator

Yeah, that part is an FS watcher that doesn't go over the wires. So somewhere between the dev server and the browser things stopped working. You mentioned on Discord that running CRA/Next.js worked, which is even weirder, because AFAIK we use a dev server setup quite similar to CRA.

You can try messing with node_modules/@docusaurus/core/lib/commands/start.js and see if changing any config fixes it.

@davidvarela-us
Copy link
Author

Working for now with --host 0.0.0.0. Thanks a bunch

@slorber
Copy link
Collaborator

slorber commented Jun 8, 2022

afaik it may happen in case you messed up things in /etc/hosts and other similar files. This is unlikely a Docusaurus issue IMHO.

@Josh-Cena
Copy link
Collaborator

@slorber I thought about hosts config issue, but yarn serve being able to work is the interesting part.

@Josh-Cena
Copy link
Collaborator

Hey—I suspect this is a websocket error. I don't have the infrastructure needed to reproduce this, so I'm going to close this for the same reason as #3652. It doesn't mean we 100% dismiss this as not our issue, but this is unactionable unless someone can step in and narrow it down to a specific place in our code. Meanwhile developing on 0.0.0.0 should be good enough.

@Josh-Cena Josh-Cena closed this as not planned Won't fix, can't repro, duplicate, stale Jun 16, 2022
@Josh-Cena Josh-Cena added status: needs more information There is not enough information to take action on the issue. and removed status: needs more information There is not enough information to take action on the issue. labels Jun 16, 2022
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