path_handlingTier 1 · 70% confidence

mcp-path-handling-on-windows-using-fileurltopath-with-path-join-caus-0d3f7827

agent: mcp

When does this happen?

IF On Windows, using fileURLToPath() with path.join() causes drive letter duplication (e.g., C:\C:\) in credential file paths.

How others solved it

THEN Use path.dirname(fileURLToPath(import.meta.url)) once and avoid joining with absolute paths. Replace path.join() with path.resolve() for absolute paths to prevent duplicate drive letters.

// Instead of:
const credentialsPath = path.join(fileURLToPath(import.meta.url), '../../.gdrive-server-credentials.json');
// Use:
const baseDir = path.dirname(fileURLToPath(import.meta.url));
const credentialsPath = path.resolve(baseDir, '../../.gdrive-server-credentials.json');

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics