From a1cae64ece408d5ddd6194f2d69774845f0da02c Mon Sep 17 00:00:00 2001 From: Vince Graics Date: Mon, 25 May 2026 11:58:25 +0200 Subject: [PATCH] fix: Use correct version resolution (like src/server.ts) in the tracing state --- src/trace/state.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/trace/state.ts b/src/trace/state.ts index 32000ed..1998110 100644 --- a/src/trace/state.ts +++ b/src/trace/state.ts @@ -1,9 +1,7 @@ -import { createRequire } from 'node:module'; import type { TraceSession } from './types.js'; +import pkg from '../../package.json' with { type: 'json' }; -const require = createRequire(import.meta.url); -const { version: LIBRARY_VERSION } = require('../../package.json') as { version: string }; - +const libraryVersion = pkg.version; const traceSessions = new Map(); export function createTraceSession( @@ -35,7 +33,7 @@ export function createTraceSession( type: 'context-options', origin: 'library', libraryName: '@wdio/mcp', - libraryVersion: LIBRARY_VERSION, + libraryVersion, browserName, platform: process.platform === 'darwin' ? 'darwin' : process.platform === 'win32' ? 'windows' : 'linux', wallTime: session.startWallTime,