From 58dd51e3d32ac88fb7a4483750d49ea3027f42a3 Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Fri, 20 Feb 2026 14:03:00 +0100 Subject: [PATCH] chore: do not suppress uncaught errors in tests --- scripts/test.mjs | 1 + src/main.ts | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/test.mjs b/scripts/test.mjs index 396996b15..43ee3871b 100644 --- a/scripts/test.mjs +++ b/scripts/test.mjs @@ -68,6 +68,7 @@ async function runTests(attempt) { env: { ...process.env, CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS: true, + CHROME_DEVTOOLS_MCP_CRASH_ON_UNCAUGHT: true, }, }); diff --git a/src/main.ts b/src/main.ts index 9a7f9e755..7ae73fe0c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -58,9 +58,11 @@ if (args.usageStatistics) { }); } -process.on('unhandledRejection', (reason, promise) => { - logger('Unhandled promise rejection', promise, reason); -}); +if (process.env['CHROME_DEVTOOLS_MCP_CRASH_ON_UNCAUGHT'] !== 'true') { + process.on('unhandledRejection', (reason, promise) => { + logger('Unhandled promise rejection', promise, reason); + }); +} logger(`Starting Chrome DevTools MCP Server v${VERSION}`); const server = new McpServer(