From c68efece7400bc7440a10040cfa1efa83994f6d1 Mon Sep 17 00:00:00 2001 From: renuka16032007 Date: Wed, 15 Apr 2026 22:55:15 +0530 Subject: [PATCH] Fix harness crash (#25266) Co-authored-by: Tommaso Sciortino --- packages/cli/src/utils/resolvePath.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/utils/resolvePath.ts b/packages/cli/src/utils/resolvePath.ts index 14d5f77cbb..3a9d2dc0c8 100644 --- a/packages/cli/src/utils/resolvePath.ts +++ b/packages/cli/src/utils/resolvePath.ts @@ -17,5 +17,12 @@ export function resolvePath(p: string): string { } else if (p === '~' || p.startsWith('~/')) { expandedPath = homedir() + p.substring(1); } - return path.normalize(expandedPath); + try { + return path.normalize(expandedPath); + } catch (err: unknown) { + if (err instanceof Error && 'code' in err && err.code === 'ENAMETOOLONG') { + return expandedPath; + } + throw err; + } }