Skip to content

Docusaurus doesn't respect the $PORT environment variable #8681

@seyoon20087

Description

@seyoon20087

**NOTE: If you believe this is a question please convert it to a discussion (rather than closing it), cf https://bit.ly/3YWp3GJ

Have you read the Contributing Guidelines on issues?

Prerequisites

Description

Docusaurus is not respecting the $PORT environment variable.

For example if I specify env PORT=8000 yarn start it will start on port 3000 and not on 8000.

Reproducible demo

https://github.com/seyoon20087/docusaurus-reproduction-port-env-not-respecting

Steps to reproduce

  1. Clone that repository
  2. Install dependencies (yarn)
  3. Attempt to start the server at port 8000, using env PORT=8000 yarn start
  4. The server will start at port 3000 and not 8000

Expected behavior

I expected that the server should start in the port on the $PORT environment variable specified

Actual behavior

The server will start on 3000 if I don't use --port option.
This is different from other frameworks (like Next.js), which they respect the $PORT environment variable.

For your reference here is the screenshot:
image

Your environment

Self-service

  • I'd be willing to fix this bug myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions