Jette
Jette

Reputation: 2609

Angular 12 ignoring configuration files or reading from some cache?

Angular keeps warning me about IE 11:

Warning: Support was requested for IE 11 in the project's browserslist configuration. IE 11 support is deprecated since Angular v12.

I came across this answer:

Angular 12 warns about requested IE 11 support. Why?

I changed my .browserslistrc file as recommended, and it now looks like this:

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

But I still get the warning.

I also have an issue with aot (Maximum call stack size error) so I set aot to false. The error disappeared. I would expect the error to reappear when setting aot back to true, but it didn't. Then I used another build config where aot is true, and the error is back.

Is Angular saving config in some kind of cache that I need to purge between builds? Because it seems that the changes I make in config files, does not always take effect.

Upvotes: 1

Views: 2165

Answers (2)

ckapilla
ckapilla

Reputation: 1178

npx browserslist showed that I had to use: not IE 10 not IE 11 not ie_mob 10 not ie_mob 11 which got rid of the warnings

Upvotes: 0

Jp Vinjamoori
Jp Vinjamoori

Reputation: 1271

The following answer assumes you are using npm as package manager

  1. Ensure that you dont have browserlist in your package.json "browserslist": [ ... browser list ...] If you have it will override definition from .browserlistrc file
  2. Ensure that .browserlistrc is at the same folder as your package.json and where folder node_modules is created
  3. Ensure that you clean your dist folder to removed before clean build

Check the browsers your config supports

Type the following command to find out what browsers are included npx browserslist

If the output of the above command indicates what browsers/versions are included

Cache

Finally coming the cache read the link here

Add/Set following environment variable (value doesn't matter, just its presence will disable cache)

BROWSERSLIST_DISABLE_CACHE

If you are using webpack for packaging, you can explicitly clear the cache by calling browserslist.clearCaches()

If above doesn't work, try deleting folder node_modules and package.json and run npm install to clear the cache

Upvotes: 3

Related Questions