Skip to content

ng update fails to remove polyfills leaving broken code behind (8rc 4) #14443

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

Closed
ashley-hunter opened this issue May 16, 2019 · 2 comments · Fixed by #14448
Closed

ng update fails to remove polyfills leaving broken code behind (8rc 4) #14443

ashley-hunter opened this issue May 16, 2019 · 2 comments · Fixed by #14448

Comments

@ashley-hunter
Copy link

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [x] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

Yes, previous ng updates that I have tried worked as expected.

Description

When running ng update @angular/cli @angular/core --next the process completes successfully, however the polyfills file has been left broken. It appears to have attempted to remove the core-js imports although failed half way through leaving half a line of code:

/***************************************************************************************************
* BROWSER POLYFILLS
*/
k-map';
import 'core-js/es6/set';

/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js';  // Run `npm install --save classlist.js`.

All imports after the broken line are not removed. This obviously causes the build to fail.

🔬 Minimal Reproduction

Clone this repo: https://github.com/UXAspects/UXAspects-Seed
Perform the update: ng update @angular/cli @angular/core --next --force
CLI will report success, however the broken code now remains

🔥 Exception or Error

No exceptions during update, reports successful update

🌍 Your Environment


Angular CLI: 8.0.0-rc.4
Node: 10.15.1
OS: win32 x64
Angular: 8.0.0-rc.4
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, upgrade

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.0-rc.4
@angular-devkit/build-angular     0.800.0-rc.4
@angular-devkit/build-optimizer   0.800.0-rc.4
@angular-devkit/build-webpack     0.800.0-rc.4
@angular-devkit/core              8.0.0-rc.4
@angular-devkit/schematics        8.0.0-rc.4
@angular/cdk                      7.3.1
@angular/http                     7.2.3
@ngtools/webpack                  8.0.0-rc.4
@schematics/angular               8.0.0-rc.4
@schematics/update                0.800.0-rc.4
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.30.0

Anything else relevant?
No

@alan-agius4
Copy link
Collaborator

Comment removed, as I managed to replicate this on windows.

@alan-agius4 alan-agius4 self-assigned this May 16, 2019
mgechev pushed a commit that referenced this issue May 17, 2019
…windows

Replacment of line endings should only happen to increase the hash matches as otherwise the recorder will fail to update the correct positions

Fixes #14443
mgechev pushed a commit that referenced this issue May 17, 2019
…windows

Replacment of line endings should only happen to increase the hash matches as otherwise the recorder will fail to update the correct positions

Fixes #14443
@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 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants