Skip to content

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

Closed
@ashley-hunter

Description

@ashley-hunter

🐞 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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions