Skip to content

Commit 72d590a

Browse files
authored
Don't report Node deprecation warnings as script errors (#14616)
runVSCodeCommand only resolves on success (it throws on a non-zero exit), so its stderr is non-fatal output such as the Node [DEP0169] url.parse() deprecation warning emitted by the VS Code CLI. Log it as a warning instead of an error in installAndCopyBinaries.ts, and add DEP0169 to the test.ts stdio filter list.
1 parent 0c7a60d commit 72d590a

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

Extension/.scripts/installAndCopyBinaries.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { runVSCodeCommand } from '@vscode/test-electron';
77
import { writeFile } from 'node:fs/promises';
88
import { join } from 'node:path';
9-
import { $root, error, heading, note } from './common';
9+
import { $root, error, heading, note, warn } from './common';
1010
import * as copy from './copyExtensionBinaries';
1111
import { install, isolated, options } from "./vscode";
1212

@@ -24,7 +24,9 @@ export async function main() {
2424
console.log(result.stdout.toString());
2525
}
2626
if (result.stderr) {
27-
error(result.stderr.toString());
27+
// runVSCodeCommand resolves only when the command succeeds (it throws on a non-zero exit), so stderr here is
28+
// non-fatal output such as Node deprecation warnings and must not be reported as an error.
29+
warn(result.stderr.toString());
2830
}
2931

3032
const binaryVersion = await copy.main(isolated);

Extension/.scripts/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const filters = [
2727
/^Unexpected token A/,
2828
/Cannot register 'cmake.cmakePath'/,
2929
/\[DEP0005\] DeprecationWarning/,
30+
/\[DEP0169\] DeprecationWarning/,
3031
/--trace-deprecation/,
3132
/Iconv-lite warning/,
3233
/^Extension '/,

0 commit comments

Comments
 (0)