Skip to content

Commit

Permalink
fix(@ngtools/webpack): don't set ngprogram to null
Browse files Browse the repository at this point in the history
  • Loading branch information
filipesilva authored and vikerman committed Oct 17, 2019
1 parent cda57ae commit ab70e61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/ngtools/webpack/src/angular_compiler_plugin.ts
Expand Up @@ -91,7 +91,7 @@ export class AngularCompilerPlugin {
// TS compilation.
private _compilerOptions: CompilerOptions;
private _rootNames: string[];
private _program: (ts.Program | Program) | null;
private _program: (ts.Program | Program) | undefined;
private _compilerHost: WebpackCompilerHost & CompilerHost;
private _moduleResolutionCache: ts.ModuleResolutionCache;
private _resourceLoader?: WebpackResourceLoader;
Expand Down Expand Up @@ -673,7 +673,7 @@ export class AngularCompilerPlugin {
// only present for webpack 4.23.0+, assume true otherwise
const watchMode = rootCompiler.watchMode === undefined ? true : rootCompiler.watchMode;
if (!watchMode) {
this._program = null;
this._program = undefined;
this._transformers = [];
this._resourceLoader = undefined;
this._compilerHost.reset();
Expand Down Expand Up @@ -1385,7 +1385,7 @@ export class AngularCompilerPlugin {
} else {
errMsg = e.stack;
// It is not a syntax error we might have a program with unknown state, discard it.
this._program = null;
this._program = undefined;
code = UNKNOWN_ERROR_CODE;
}
allDiagnostics.push(
Expand Down
5 changes: 1 addition & 4 deletions tests/angular_devkit/build_webpack/angular-app/tsconfig.json
Expand Up @@ -18,10 +18,7 @@
]
},
"angularCompilerOptions": {
// TODO: debug this problem.
// This should really be true but was getting the error below on every second build.
// `ERROR in Cannot read property 'incrementalState' of null`
"enableIvy": false,
"enableIvy": true,
"disableTypeScriptVersionCheck": true
}
}

0 comments on commit ab70e61

Please sign in to comment.