From 6218c3b463898995d8b1fe2e558b05c1dee1a13c Mon Sep 17 00:00:00 2001 From: jerrykingxyz Date: Mon, 1 Jul 2024 16:34:36 +0800 Subject: [PATCH] fix: tsconfig self-references cause short-lived invaild cache --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index ac95d63f..e64f9fcb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1096,6 +1096,10 @@ impl ResolverGeneric { let directory = tsconfig.directory().to_path_buf(); for reference in &mut tsconfig.references { let reference_tsconfig_path = directory.normalize_with(&reference.path); + if reference_tsconfig_path == path { + // skip current working path to avoid setting cache as a invalid value + continue; + } let tsconfig = self.cache.tsconfig( /* root */ true, &reference_tsconfig_path,