Angular-cli: ng update fails to remove polyfills leaving broken code behind (8rc 4)

Created on 16 May 2019  路  2Comments  路  Source: angular/angular-cli

馃悶 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

schematicupdate high broken bufix

Most helpful comment

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

All 2 comments

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

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._

Was this page helpful?
0 / 5 - 0 ratings