-
Notifications
You must be signed in to change notification settings - Fork 12k
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(@ngtools/webpack): fix #7615, check if this.done is defined before delaying resolvers #7619
Conversation
@@ -390,7 +390,7 @@ 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') | |||
if (this.done && request.request.endsWith('.ts') | |||
|| (request.context.issuer && request.context.issuer.endsWith('.ts'))) { | |||
this.done!.then(() => cb(), () => cb()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, could you remove the !
here? It won't be needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
@@ -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') | |||
if (this.done && request.request.endsWith('.ts') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bad logic? shouldn't it be:
if (this.done
&& (request.request.endsWith('.ts')
|| (request.context.issuer && request.context.issuer.endsWith('.ts')))) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. I missed the second line (not a fan of the line break here). Fixed in next version.
Check if this.done is defined before delaying file access
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Resolves #7615