Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 12 update issue: Unknown error from PostCSS plugin

Hi after I ran "ng update @angular/core@12 @angular/cli@12" to upgrade from 11 to 12, and then "ng serve app" I keep getting the following error: "Unknown error from PostCSS plugin. Your current PostCSS version is 8.2.14, but postcss-preset-env uses 7.0.35. Perhaps this is the source of the error below."

What's my problem? No PostCSS in package.json. I don't know about it. Thanks in advance.PostCSS error

like image 614
Telly Ipock Avatar asked Oct 14 '22 21:10

Telly Ipock


2 Answers

The issue seems to be related to the file .browserslistrc, renamed from browserlist during the upgrade migration. I resolved this issue by creating a new angular app, but only for the purposes of creating the default .browserslistrc file, and then copied that file to my upgraded app.

like image 81
PAR Avatar answered Oct 20 '22 12:10

PAR


Update .browserlistrc to 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 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
like image 28
xinthose Avatar answered Oct 20 '22 11:10

xinthose