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) +