diff --git a/test/turbopack-build-tests-manifest.json b/test/turbopack-build-tests-manifest.json index 630fad96a4de9..1029bce22ce69 100644 --- a/test/turbopack-build-tests-manifest.json +++ b/test/turbopack-build-tests-manifest.json @@ -12686,10 +12686,10 @@ "runtimeError": false }, "test/integration/jsconfig-empty/test/index.test.js": { - "passed": [], - "failed": [ + "passed": [ "Empty JSConfig Support production mode should compile successfully" ], + "failed": [], "pending": [], "flakey": [], "runtimeError": false @@ -15264,11 +15264,10 @@ "tsconfig.json verifier allows you to set target mode", "tsconfig.json verifier allows you to set verbatimModuleSyntax true via extends without adding isolatedModules", "tsconfig.json verifier allows you to set verbatimModuleSyntax true without adding isolatedModules", - "tsconfig.json verifier creates compilerOptions when you extend another config" - ], - "failed": [ + "tsconfig.json verifier creates compilerOptions when you extend another config", "tsconfig.json verifier Works with an empty tsconfig.json (docs)" ], + "failed": [], "pending": [ "tsconfig.json verifier allows you to skip moduleResolution, esModuleInterop and resolveJsonModule when using \"module: preserve\"" ], diff --git a/turbopack/crates/turbopack-resolve/src/typescript.rs b/turbopack/crates/turbopack-resolve/src/typescript.rs index 5d04cb9c027f3..af91e6e91d0e0 100644 --- a/turbopack/crates/turbopack-resolve/src/typescript.rs +++ b/turbopack/crates/turbopack-resolve/src/typescript.rs @@ -53,6 +53,13 @@ pub async fn read_tsconfigs( let mut configs = Vec::new(); let resolve_options = json_only(resolve_options); loop { + // tsc ignores empty config files. + if let FileContent::Content(file) = &*data.await? { + if file.content().is_empty() { + break; + } + } + let parsed_data = data.parse_json_with_comments(); match &*parsed_data.await? { FileJsonContent::Unparseable(e) => {