Skip to content
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 cache invalidation error when watching #5164

Closed
wants to merge 1 commit into from

Conversation

randombk
Copy link

@randombk randombk commented Mar 2, 2017

Update of #4009 by @rynclark to latest version of codebase.

TypeScript caches the contents of source files within the program
to minimize redundant compilation of non-changing code. This cache
is not invalidated in @ngtools/webpack, causing two issues:
1. When the watcher is triggered, the old version of the source
is used. A second save is necessary for changes to take effect.
2. When a change would result in a compilation error, the initial
save will pass without errors. Subsequent saves, even saves
containing fixes to the original error, will continue to fail
with the original error. This is likely caused by TypeScript
trying to compare any new programs against an invalid prior
program state.

Possibly also addresses #4566.

Signed-off-by: RandomBK [email protected]

  Update of angular#4009 by @rynclark to latest version of codebase.

  TypeScript caches the contents of source files within the program
  to minimize redundant compilation of non-changing code. This cache
  is not invalidated in @ngtools/webpack, causing two issues:
    1. When the watcher is triggered, the old version of the source
       is used. A second save is necessary for changes to take effect.
    2. When a change would result in a compilation error, the initial
       save will pass without errors. Subsequent saves, even saves
       containing fixes to the original error, will continue to fail
       with the original error. This is likely caused by TypeScript
       trying to compare any new programs against an invalid prior
       program state.

Signed-off-by: RandomBK <[email protected]>
@filipesilva
Copy link
Contributor

Closing in favor of #4009, it's better to discuss it in the original PR.

@filipesilva filipesilva closed this Mar 8, 2017
@angular-automatic-lock-bot
Copy link

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 11, 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.

3 participants