Skip to content

Commit ebd87ad

Browse files
rezonanthansl
authored andcommitted
fix(@ngtools/webpack): fix for #7615
Check if this.done is defined before delaying file access
1 parent 645e56b commit ebd87ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/@ngtools/webpack/src/plugin.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,9 @@ export class AotPlugin implements Tapable {
390390
// Wait for the plugin to be done when requesting `.ts` files directly (entry points), or
391391
// when the issuer is a `.ts` file.
392392
compiler.resolvers.normal.plugin('before-resolve', (request: any, cb: () => void) => {
393-
if (request.request.endsWith('.ts')
394-
|| (request.context.issuer && request.context.issuer.endsWith('.ts'))) {
395-
this.done!.then(() => cb(), () => cb());
393+
if (this.done && (request.request.endsWith('.ts')
394+
|| (request.context.issuer && request.context.issuer.endsWith('.ts')))) {
395+
this.done.then(() => cb(), () => cb());
396396
} else {
397397
cb();
398398
}

0 commit comments

Comments
 (0)