Issue
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.
Solution
The following answer assumes you are using npm as package manager
- Ensure that you dont have
browserlist
in your package.json"browserslist": [ ... browser list ...]
If you have it will override definition from.browserlistrc
file - Ensure that .browserlistrc is at the same folder as your package.json and where folder
node_modules
is created - 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
Answered By - Jp Vinjamoori
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.