You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[firebase-vscode] CLI version check reads the version from the debug banner, because logSetup() leaks DEBUG=true into the spawned firebase --version (follow-up to #10874) #11363
firebase-tools: 15.33.0 (global npm install); Firebase Data Connect for VS Code 2.4.3, and the current main of firebase-vscode/src/extension.ts
Platform: Windows 11
[REQUIRED] Test case
logSetup() in firebase-vscode/src/logger-wrapper.ts sets process.env.DEBUG = "true". checkCLIInstallation() in firebase-vscode/src/extension.ts then spawns firebase --version with env = { ...process.env, VSCODE_CWD: "" }, so the CLI sees DEBUG=true and prints its debug banner on stdout before the version:
Run firebase --version with DEBUG=true in the environment, and save stdout.
Pass it to the version parsing in checkCLIInstallation(): semver.valid(out) || semver.coerce(out)?.version.
[REQUIRED] Expected behavior
The check reads 15.33.0, and warns when the installed CLI is older than npm's latest.
[REQUIRED] Actual behavior
With semver 7.8.5, on the stdout above:
semver.valid(out) is null;
semver.coerce(out)?.version is 2026.0.0, the year of the banner's first timestamp.
In 2.4.3, which parses with semver.valid() alone, this shows "The Firebase CLI is not installed (or not available on $PATH)" on every activation. #10874 (unreleased so far) adds the coerce fallback, which hides that warning, but the version it reads is 2026.0.0. So the "outdated version" warning can never fire while DEBUG leaks, and the logged version is wrong.
Suggested fix: remove DEBUG from the env of the spawned check (const env = { ...process.env, VSCODE_CWD: "" }; delete env.DEBUG;), or keep the extension's logging flag out of process.env, since it reaches every child process the extension starts. Earlier report of the same warning on Windows: #7910.
Thanks for the thorough report and for debugging the issue @vgerasymenko! I think your observations are correct. When the DEBUG env var is set to true, the output of running firebase --version will include the debug banner, which causes us to incorrectly parse the version.
I think a minimal code that reproduces this behavior would look like
minimal code
const{ spawnSync }=require("child_process");constsemver=require("semver")// set DEBUG envprocess.env.DEBUG=true// parts vs-code code to determine firebase-tools version// see https://github.com/firebase/firebase-tools/blob/855f140c7b55cd46e4ff00f030a1d1268b42f1d0/firebase-vscode/src/extension.ts#L94-L117constenv={ ...process.env,VSCODE_CWD: ""};constisWin=process.platform==="win32";constshell=process.env.SHELL||"/bin/bash";constspawnOptions=isWin ? { env,shell: true} : { env };construnCommand=(cmd)=>{if(isWin){returnspawnSync(cmd,spawnOptions);}returnspawnSync(shell,["-l","-c",cmd],spawnOptions);};constversionRes=runCommand("firebase --version");constversionStdout=versionRes.status===0 ? versionRes.stdout?.toString().trim() : "";constcurrentVersion=versionStdout
? (semver.valid(versionStdout)||semver.coerce(versionStdout)?.version)
: undefined;console.log(versionRes.stdout.toString())// outputs full logs that include that debug bannerconsole.log(currentVersion)// outputs 2026.0.0
I'll raise this issue to our engineering team and mark it as reproducible. Since it looks like you've correctly identified the root cause, feel free to open up a PR for this if you're up for it! Otherwise, someone from our engineering team will take a look into this shortly.
Activity
aalej commentedon Oct 27, 2026
Thanks for the thorough report and for debugging the issue @vgerasymenko! I think your observations are correct. When the
DEBUGenv var is set to true, the output of runningfirebase --versionwill include the debug banner, which causes us to incorrectly parse the version.I think a minimal code that reproduces this behavior would look like
minimal code
I'll raise this issue to our engineering team and mark it as reproducible. Since it looks like you've correctly identified the root cause, feel free to open up a PR for this if you're up for it! Otherwise, someone from our engineering team will take a look into this shortly.
vgerasymenko commentedon Oct 27, 2026
Two simple proposals are presented above, not sure which one better aligns with the extension logic regarding child processes.