0

So I recently upgraded my Angular packages to 16, as my understanding the Angular 16 devkit switched from Webpack to Vite. We have not changed anything in the tsconfig file or any other build configuration file.

However every time we try to build we get this error:

Error: Optimization error [main.c3f825f1c692aa5f.js]: X [ERROR] Transforming destructuring to the configured target environment ("chrome86.0", "edge16.0", "firefox83.0", "ios11.0", "safari11.0") is not supported yet

main.c3f825f1c692aa5f.js:89728:12:
  89728 │       const {

For some reason it does not transform to older JS versions if I understood the error correctly. Does anyone know what I should do, or have I missed some type of documentation?

saman93
  • 157
  • 10

1 Answers1

0

Okay for anyone facing the same issue.

The issue was a old .browserslistrc

You can read more about it here: My project doesn't compile with optimization parameters after upgrading from angular 11 to angular 12

Kind of the similiar issue.

I just updated it to

# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For IE 9-11 support, please uncomment the last line of the file and adjust as needed
> 0.5%
last 2 versions
Firefox ESR
not dead
# IE 9-11
saman93
  • 157
  • 10