Skip to content

fix(@ngtools/webpack): fix #7615, check if this.done is defined before delaying resolvers - #7619

Merged
hansl merged 1 commit into
angular:masterfrom
rezonant:fix-7615
Sep 13, 2017
Merged

fix(@ngtools/webpack): fix #7615, check if this.done is defined before delaying resolvers#7619
hansl merged 1 commit into
angular:masterfrom
rezonant:fix-7615

Conversation

@rezonant

@rezonant rezonant commented Sep 7, 2017

Copy link
Copy Markdown
Contributor

Resolves #7615

@rezonant rezonant changed the title Fix for 7615: Check if this.done is defined before delaying resolvers fix(@ngtools/webpack): fix #7615, check if this.done is defined before delaying resolvers Sep 7, 2017
Comment thread packages/@ngtools/webpack/src/plugin.ts Outdated
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());

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

Comment thread packages/@ngtools/webpack/src/plugin.ts Outdated
// 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')

Copy link
Copy Markdown
Member

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')))) {

Copy link
Copy Markdown
Contributor Author

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
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: Cannot read property 'then' of undefined when used with serviceworker-webpack-plugin

4 participants