Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler-cli): emitting references to ngtypecheck files #57138

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/compiler-cli/src/ngtsc/core/src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ import {DiagnosticCategoryLabel, NgCompilerAdapter, NgCompilerOptions} from '../
import {coreHasSymbol} from './core_version';
import {coreVersionSupportsFeature} from './feature_detection';
import {angularJitApplicationTransform} from '../../transform/jit';
import {untagAllTsFiles} from '../../shims';

/**
* State information about a compilation which is only generated once some data is requested from
Expand Down Expand Up @@ -793,6 +794,10 @@ export class NgCompiler {
} {
const compilation = this.ensureAnalyzed();

// Untag all the files, otherwise TS 5.4 may end up emitting
// references to typecheck files (see #56945 and #57135).
untagAllTsFiles(this.inputProgram);

const coreImportsFrom = compilation.isCore ? getR3SymbolsFile(this.inputProgram) : null;
let importRewriter: ImportRewriter;
if (coreImportsFrom !== null) {
Expand Down
6 changes: 1 addition & 5 deletions packages/compiler-cli/src/ngtsc/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {IndexedComponent} from './indexer';
import {ActivePerfRecorder, PerfCheckpoint as PerfCheckpoint, PerfEvent, PerfPhase} from './perf';
import {TsCreateProgramDriver} from './program_driver';
import {DeclarationNode} from './reflection';
import {retagAllTsFiles, untagAllTsFiles} from './shims';
import {retagAllTsFiles} from './shims';
import {OptimizeFor} from './typecheck/api';

/**
Expand Down Expand Up @@ -293,10 +293,6 @@ export class NgtscProgram implements api.Program {
}
}

// Untag all the files, otherwise TS 5.4 may end up emitting
// references to typecheck files (see #56945).
untagAllTsFiles(this.tsProgram);

const forceEmit = opts?.forceEmit ?? false;

this.compiler.perfRecorder.memory(PerfCheckpoint.PreEmit);
Expand Down