After updating Angular to version 15, where the target
of compilerOptions
is automatically set to ES2022
, my angular web component is not working anymore for Chrome 53.
This error is showing in console: Uncaught SyntaxError: Unexpected token {
I am importing the following polyfills:
- custom-elements-es5-adapter.js
- webcomponents-bundle.js
I tried to lower the Chrome version in browserlist
, but this has no affect. Changing the target doesn't help either, because Angular CLI sets it back to es2022
and shows this message: TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022" and "false" respectively by the Angular CLI.
Does somebody know how to let angular web components work again on old Chrome browsers for Angular 15?
it is possible that for Angular 15 the Typescript version is also to upgrade to (4.2) it has new features and improvements and your code is possibly not fully compatible, maybe you have to adjust the code a bit