-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Labels
featureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Description
**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?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand 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
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
Steps to reproduce
- Clone that repository
- Install dependencies (
yarn) - Attempt to start the server at port 8000, using
env PORT=8000 yarn start - 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:

Your environment
- Public source code: https://github.com/seyoon20087/docusaurus-reproduction-port-env-not-respecting
- Public site URL: Not relevant
- Docusaurus version used: 2.3.1 -- note that this issue applies to any current Docusaurus version
- Environment name and version (e.g. Chrome 89, Node.js 16.4): Node.js 16.19.0
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): Gitpod (Ubuntu 20.04.5 container)
Self-service
- I'd be willing to fix this bug myself.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.This is not a bug or issue with Docusausus, per se. It is a feature request for the future.