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

--host 0.0.0.0 Operation does not work #10772

Open
6 of 7 tasks
lixumin-zai opened this issue Dec 15, 2024 · 4 comments
Open
6 of 7 tasks

--host 0.0.0.0 Operation does not work #10772

lixumin-zai opened this issue Dec 15, 2024 · 4 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@lixumin-zai
Copy link

lixumin-zai commented Dec 15, 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

I tried to use "npm run start -- --host 0.0.0.0" or "npx docusaurus start --host 0.0.0.0", but it didn't work
image

node: v18.20.5
docusaurus: 3.6.3

Reproducible demo

No response

Steps to reproduce

  1. npx create-docusaurus@latest my-website classic
  2. cd my-website
  3. npm start -- --host 0.0.0.0 or npx docusaurus start --host 0.0.0.0

Expected behavior

I want other machines to be able to access the website as well

Actual behavior

He's still starting in localhost

Your environment

  • Public source code: No
  • Public site URL: No
  • Docusaurus version used: 3.6.3
  • Environment name and version (e.g. Chrome 89, Node.js 18.20.5):
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS):

Self-service

  • I'd be willing to fix this bug myself.
@lixumin-zai lixumin-zai 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 Dec 15, 2024
@slorber
Copy link
Collaborator

slorber commented Dec 19, 2024

0.0.0.0 isn't what gets printed to the console, but it's technically working:

CleanShot 2024-12-19 at 11 53 21

We use this package that apparently prints localhost for 0.0.0.0, wondering is this a big deal and worth fixing.

https://github.com/facebook/create-react-app/blob/main/packages/react-dev-utils/WebpackDevServerUtils.js#L24C10-L24C21

@slorber slorber removed the status: needs triage This issue has not been triaged by maintainers label Dec 19, 2024
@lixumin-zai
Copy link
Author

0.0.0.0 indicates that other clients should also be able to access the services of the server, but this doesn't work. I can use it normally on the server. However, when I try to access the IP address of the server where it is started (followed by port 3000) from other machines, the page I get is blank.

@lixumin-zai
Copy link
Author

So I had to do port forwarding

@slorber
Copy link
Collaborator

slorber commented Dec 20, 2024

Sorry but I'm not able to understand what you are trying to achieve, what is your exact setup and what are the computers involved, your current network topology.

npm start is only meant to be used in dev locally, not exposed through the internet

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
Projects
None yet
Development

No branches or pull requests

2 participants