From a5add500e14f267ca365965b1f0f11d500ea3732 Mon Sep 17 00:00:00 2001 From: William Lahti Date: Tue, 12 Sep 2017 10:57:52 -0700 Subject: [PATCH] fix(@ngtools/webpack): fix for #7615 Check if this.done is defined before delaying file access --- packages/@ngtools/webpack/src/plugin.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@ngtools/webpack/src/plugin.ts b/packages/@ngtools/webpack/src/plugin.ts index 5fdf11462c02..82ff8c75bcd3 100644 --- a/packages/@ngtools/webpack/src/plugin.ts +++ b/packages/@ngtools/webpack/src/plugin.ts @@ -390,9 +390,9 @@ export class AotPlugin implements Tapable { // Wait for the plugin to be done when requesting `.ts` files directly (entry points), or // when the issuer is a `.ts` file. compiler.resolvers.normal.plugin('before-resolve', (request: any, cb: () => void) => { - if (request.request.endsWith('.ts') - || (request.context.issuer && request.context.issuer.endsWith('.ts'))) { - this.done!.then(() => cb(), () => cb()); + if (this.done && (request.request.endsWith('.ts') + || (request.context.issuer && request.context.issuer.endsWith('.ts')))) { + this.done.then(() => cb(), () => cb()); } else { cb(); }