From 9c5dafbe8d23cad56e56c340ae0fd76a7e425823 Mon Sep 17 00:00:00 2001 From: Dev Randalpura Date: Thu, 14 May 2026 15:09:47 -0400 Subject: [PATCH] Added ENAMETOOLONG and ENOTDIR to exceptions for errors --- packages/core/src/utils/paths.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/core/src/utils/paths.ts b/packages/core/src/utils/paths.ts index c2439e247b3..b385d2d25ef 100644 --- a/packages/core/src/utils/paths.ts +++ b/packages/core/src/utils/paths.ts @@ -440,7 +440,10 @@ function robustRealpath(p: string, visited = new Set()): string { e && typeof e === 'object' && 'code' in e && - (e.code === 'ENOENT' || e.code === 'EISDIR') + (e.code === 'ENOENT' || + e.code === 'EISDIR' || + e.code === 'ENAMETOOLONG' || + e.code === 'ENOTDIR') ) { try { const stat = fs.lstatSync(p); @@ -457,7 +460,10 @@ function robustRealpath(p: string, visited = new Set()): string { lstatError && typeof lstatError === 'object' && 'code' in lstatError && - (lstatError.code === 'ENOENT' || lstatError.code === 'EISDIR') + (lstatError.code === 'ENOENT' || + lstatError.code === 'EISDIR' || + lstatError.code === 'ENAMETOOLONG' || + lstatError.code === 'ENOTDIR') ) ) { throw lstatError;