Skip to content

Pass --use-env-proxy only when the node version is >= 24#6064

Merged
canova merged 3 commits into
firefox-devtools:mainfrom
canova:cli-node22
May 27, 2026
Merged

Pass --use-env-proxy only when the node version is >= 24#6064
canova merged 3 commits into
firefox-devtools:mainfrom
canova:cli-node22

Conversation

@canova

@canova canova commented May 27, 2026

Copy link
Copy Markdown
Member

@jesup found out this issue on his machine. He uses Fedora 43 which has node 22 as the latest version.

See also individual commit messages.
--use-env-proxy was added in Node.js 24, and I added that in #6003 to make sandboxed anvironments work. But the cli now stopped working for the users who has node version that's below 24. This PR adds this flag conditionally if the node version is above that.

Note that sandboxed environments might not work for node < 24. But I added a warning log to the users explaining that.

canova added 2 commits May 27, 2026 20:41
The flag was added in Node 24. On older runtimes node exits immediately
with "bad option" before the daemon can write any log, create the
session directory, or bind its socket. The client process has no
visibility into the spawned daemon (stdio is ignored and no exit
listener is attached), so the user only sees "Failed to start daemon:
session not validated after 500ms" with no indication that the daemon
crashed on startup.

Pass the flag conditionally based on process.versions.node, and warn
on stderr when a proxy env var is set but the runtime is too old to
honor it.
startNewDaemon previously spawned the daemon with stdio: 'ignore' and
no exit listener, so any spawn-time failure (unsupported Node flag,
missing dependency, immediate crash) surfaced only as a generic
"session not validated after 500ms" timeout. The user had no way to
tell whether the daemon was slow to start or had died on launch.

Attach 'exit' and 'error' listeners to the spawned child and check
them on every phase 1 polling iteration (and once after the loop, in
case the daemon exits while a final validation is in flight). When
the daemon dies early, throw an error that includes the exit code or
signal and points the user at the session log directory.
@canova canova requested a review from mstange May 27, 2026 18:48
@codecov

codecov Bot commented May 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.77%. Comparing base (3182970) to head (9faa037).
⚠️ Report is 33 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6064      +/-   ##
==========================================
- Coverage   83.78%   83.77%   -0.01%     
==========================================
  Files         329      329              
  Lines       34528    34547      +19     
  Branches     9659     9667       +8     
==========================================
+ Hits        28930    28943      +13     
- Misses       5169     5175       +6     
  Partials      429      429              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@canova canova merged commit bdfa55d into firefox-devtools:main May 27, 2026
23 checks passed
@canova canova mentioned this pull request Jun 16, 2026
canova added a commit that referenced this pull request Jun 16, 2026
Changes:

[Nazım Can Altınova] Fix call node context menu being hidden behind
source view bottom box (#6045)
[Nazım Can Altınova] Pass `--use-env-proxy` only when the node version
is >= 24 (#6064)
[fatadel] Upgrade @firefox-devtools/react-contextmenu to 5.2.4 (#6066)
[Markus Stange] Switch profiler-edit from minimist to commander (#6065)
[Markus Stange] Support reading profiles from JsonSlabs files (#6037)
[Florian Quèze] Don't fail profile processing when a marker's stack
field is not a backtrace (#6069)
[fatadel] Replace the footer-links overlay with a settings menu (#6042)
[fatadel] Upgrade @types/node to match Node 24 (#6070)
[fatadel] Remove unused undici-types package (#6074)
[cathaysia] Update isLocalURL to include LAN addresses, .local domains,
and hostn… (#5973)
[Markus Stange] Fix from-url with binary profiles (#6072)
[fatadel] Upgrade to React 19 (#6067)
[Markus Stange] Add an insertStackLabels helper. (#6076)
[fatadel] Drive counter tooltips from a tooltipRows schema (#6023)
[fatadel] Add TrackPower--tooltip-average-power-microwatt (#6080)
[Markus Stange] Downgrade to React 19.1 to fix unusable dev build
performance. (#6082)
[Nazım Can Altınova] Add source map symbolication and source view
support (#6018)
[spokodev] fix(FilterNavigatorBar): clip overflow so many breadcrumbs do
not expand the parent (#6085)
[Markus Stange] Move paddings inside the tree header cells. (#6002)
[Markus Stange] Add an --insert-label-frames argument to the
profiler-edit tool (#5966)
[Markus Stange] Stop printing "error: too many arguments" during tests.
(#6088)
[Markus Stange] More additions to profiler-edit, for sp3 profiles
(#6009)
[Nazım Can Altınova] Do not rely on localized texts in the settings menu
tests (#6101)

And special thanks to our localizers:

be: Andrei Mukamolau
de: Ger
de: Michael Köhler
de: Ralf Duehnfahr
el: Jim Spentzos
en-CA: chutten
en-GB: Ian Neal
es-CL: ravmn
fr: Théo Chevalier
fr: wy
fur: Fabio Tomat
fy-NL: Fjoerfoks
ia: Melo46
it: Francesco Lodolo [:flod]
nl: Mark Heijl
ru: Valery Ledovskoy
sr: Марко Костић (Marko Kostić)
sv-SE: Andreas Pettersson
tr: Grk
tr: Selim Şumlu
zh-CN: Olvcpr423
zh-TW: Pin-guang Chen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants