40

After upgrading Angular from v.11 to v.12 I am getting the following warning:

Warning: Support was requested for IE 11 in the project's browserslist configuration. IE 11 support is deprecated since Angular v12. For more information, see https://angular.io/guide/browser-support

I don't have browserlist in my project. And in polyfill.ts everything related to IE is commented out. Where does Angular infer this request from?

Felix
  • 9,248
  • 10
  • 57
  • 89

1 Answers1

69

I had the same issue. It's because of the missing browserslist config in your project.

If the Angular CLI compiler doesn't find a .browserslistrc file or a browserslist config in your package.json it will use the default config from the browserslist project.

At the moment (v 4.16.6) this is

> 0.5%
last 2 versions
Firefox ESR
not dead

which includes ie11-support.

I would recommend you to a add a .browserslistrc, in the root direcotry of your application (meaning in the same directory as angular.json) with a default config. f.e:

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
G. Siganos
  • 747
  • 1
  • 12
  • 21
deelde
  • 1,540
  • 13
  • 23
  • 1
    Thank you! Interesting that the size of the build (including polyfill) didn't change – Felix May 22 '21 at 16:41
  • My build output size did change: main(-es5/2015).js went down by 10K (out of 1.5MB); styles.css went down by 70 bytes! :D I guess it all depends on what you're using and whether that requires polyfills/CSS transformations for IE. – Demetrios Christopher Feb 24 '22 at 03:25
  • I just tried this with the latest Angular CLI 16.1.4, and Angular 16.1.5. I got this error: *One or more browsers which are configured in the project's Browserslist configuration will be ignored as ES5 output is not supported by the Angular CLI*. Ignored browsers: ie 11 – Norbert Norbertson Jul 17 '23 at 14:38