From 478f9f9673de0e50d7b8acae279e43e2ac96ad6a Mon Sep 17 00:00:00 2001 From: Tanner Reits Date: Wed, 1 Nov 2023 15:16:40 -0400 Subject: [PATCH] fix(compiler): ignore TS diagnostics on builds where typedef file changes --- src/compiler/transpile/run-program.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compiler/transpile/run-program.ts b/src/compiler/transpile/run-program.ts index ea1f5c09c0b..70b4da1d8fc 100644 --- a/src/compiler/transpile/run-program.ts +++ b/src/compiler/transpile/run-program.ts @@ -132,7 +132,10 @@ export const runTsProgram = async ( await Promise.all(srcRootDtsFiles); } - if (config.validateTypes) { + // TODO(STENCIL-540): remove `hasTypesChanged` check and figure out how to generate types before + // executing the TS build program so we don't get semantic diagnostic errors about referencing the + // auto-generated `components.d.ts` file. + if (config.validateTypes && !hasTypesChanged) { const tsSemantic = loadTypeScriptDiagnostics(tsBuilder.getSemanticDiagnostics()); if (config.devMode) { tsSemantic.forEach((semanticDiagnostic) => {