mdn / mdn/fred

Dev mode server start commands throw proxy error

Open
#833 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
233
Forks
61
Avg merge
1d 1h
Merged PRs (30d)
82

Description

What information was incorrect, unhelpful, or incomplete?

In the content repo, after running yarn start command, I get

Error occurred while trying to proxy: localhost:5042/en-US/

in browser. After a few refreshes, the pages start getting rendered.

Here following is the server start log:

$ yarn start
yarn run v1.22.22
$ yarn -s info:fred && yarn up-to-date-check && env-cmd --silent cross-env CONTENT_ROOT=files NODE_ENV=production FRED_PLAYGROUND_LOCAL=true FRED_PLAYGROUND_PORT=5043 FRED_PORT=5042 FRED_WRITER_MODE=true fred-server

🐥 This command is now using fred: https://github.com/mdn/fred
🐞 Please report any issues here:  https://github.com/mdn/fred/issues/new?template=bug.yml

$ node scripts/up-to-date-check.js
[server] Server started at http://localhost:5042
[server] Playground backend started on port 5043         <---- proxy error

[rari] Update for @webref/css available 6.23.11 -> 7.1.0
[rari] Updating @mdn/browser-compat-data to 7.1.8
                                                         <---- starts working fine
What did you expect to see?

It would be better if the server URLs are announced/logged after all the updating, compiling, and processing is done. Kind of like:

yarn run v1.22.22
$ yarn -s info:fred && yarn up-to-date-check && env-cmd --silent cross-env CONTENT_ROOT=files NODE_ENV=production FRED_PLAYGROUND_LOCAL=true FRED_PLAYGROUND_PORT=5043 FRED_PORT=5042 FRED_WRITER_MODE=true fred-server

🐥 This command is now using fred: https://github.com/mdn/fred
🐞 Please report any issues here:  https://github.com/mdn/fred/issues/new?template=bug.yml

$ node scripts/up-to-date-check.js
[rari] Update for @webref/css available 6.23.11 -> 7.1.0
[rari] Updating @mdn/browser-compat-data to 7.1.8

[server] Server started at http://localhost:5042
[server] Playground backend started on port 5043
Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

I tweaked my system network settings. Spent some time investigating. Brian informed me about waiting before running the URLs.
It could prove a barrier for new contributors, as they won't be able to figure out about waiting and keep thinking the setup has a problem.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with yarn start and inspect the startup flow around scripts/up-to-date-check.js and the fred-server command. Confirm when the server and playground ports become available relative to the update messages. Done means startup URLs are announced only after the update and processing steps complete, without the initial proxy error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.