From dbc44e3fbb5ac8ba0181fe5c8096a220d6708eb1 Mon Sep 17 00:00:00 2001 From: JosXa Date: Fri, 28 Nov 2025 15:48:34 +0100 Subject: [PATCH] fix: use fileURLToPath for prompt.md path resolution --- playwriter/src/mcp.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/playwriter/src/mcp.ts b/playwriter/src/mcp.ts index 79d5479..55a88f9 100644 --- a/playwriter/src/mcp.ts +++ b/playwriter/src/mcp.ts @@ -6,6 +6,7 @@ import fs from 'node:fs' import path from 'node:path' import { spawn } from 'node:child_process' import { createRequire } from 'node:module' +import { fileURLToPath } from 'node:url' import vm from 'node:vm' import dedent from 'string-dedent' import { createPatch } from 'diff' @@ -328,7 +329,7 @@ const server = new McpServer({ version: '1.0.0', }) -const promptContent = fs.readFileSync(path.join(path.dirname(new URL(import.meta.url).pathname), 'prompt.md'), 'utf-8') +const promptContent = fs.readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), 'prompt.md'), 'utf-8') server.tool( 'execute', @@ -665,3 +666,4 @@ async function main() { } main().catch(console.error) +