Skip to content

The Array.includes polyfill is not added to the polyfills-es5.ts file #14815

@destus90

Description

@destus90

🐞 Bug report

I try to run my app in IE11. In the browser console I get this error
TypeError: Object doesn't support property or method 'includes', but with Differential Loading concept Angular should automatically add the polyfills with the used setup. My browserslist looks like

> 0.5%
last 2 versions
Firefox ESR
IE 11

A temporary workaround is to add import 'core-js/features/array/includes' in the polyfills.ts file.

Command (mark with an x)

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

Is this a regression?

The previous versions don't have the Differential Loading concept

Description

See above

🔬 Minimal Reproduction

  1. See the repo https://github.com/destus90/cli-array-includes-issue
  2. Clone it, install modules and run ng build command.
  3. Run some static server (for example node-static), go to IE11 and check out the browser's console.

🔥 Exception or Error




TypeError: Object doesn't support property or method 'includes'

🌍 Your Environment




Angular CLI: 8.0.3
Node: 12.3.1
OS: win32 x64
Angular: 8.0.1
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.3
@angular-devkit/build-angular     0.800.3
@angular-devkit/build-optimizer   0.800.3
@angular-devkit/build-webpack     0.800.3
@angular-devkit/core              8.0.3
@angular-devkit/schematics        8.0.3
@angular/cli                      8.0.3
@ngtools/webpack                  8.0.3
@schematics/angular               8.0.3
@schematics/update                0.800.3
rxjs                              6.4.0
typescript                        3.4.5
webpack                           4.30.0

Anything else relevant?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions